From 8aa9d8213dfc313ceee2d0610cb158fd96bda2e8 Mon Sep 17 00:00:00 2001 From: macdonst Date: Tue, 26 Jun 2012 13:57:52 -0400 Subject: [PATCH] Cache bust returned Image URI if saveToPhotoAlbum is false --- framework/src/org/apache/cordova/CameraLauncher.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/framework/src/org/apache/cordova/CameraLauncher.java b/framework/src/org/apache/cordova/CameraLauncher.java index 496b20e8..f2ee3e67 100755 --- a/framework/src/org/apache/cordova/CameraLauncher.java +++ b/framework/src/org/apache/cordova/CameraLauncher.java @@ -395,7 +395,13 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie } // Send Uri back to JavaScript for viewing image - this.success(new PluginResult(PluginResult.Status.OK, uri.toString()), this.callbackId); + if (saveToPhotoAlbum) { + this.success(new PluginResult(PluginResult.Status.OK, uri.toString()), this.callbackId); + } else { + // If you don't want to save the file to the photo album you need to append a timestamp + // to the returned URI to do some cache busting. + this.success(new PluginResult(PluginResult.Status.OK, uri.toString() + "?" + System.currentTimeMillis()), this.callbackId); + } } this.cleanup(FILE_URI, this.imageUri, bitmap);