Cache bust returned Image URI if saveToPhotoAlbum is false

This commit is contained in:
macdonst 2012-06-26 13:57:52 -04:00
parent a74f71c935
commit 8aa9d8213d

View File

@ -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);