mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
Issue #156: Camera.DestinationType.FILE_URI on Android not conforming to API Spec
Instead of capturing the orginal image to /sdcard/Pic.jpg or /sdcard/Capture.jpg we detect if the SD card is mounted. If mounted the file is placed in the apps temp directory at:
/sdcard/Android/data/{package name}/cache/
If the SD card is not mounted we default to internal storage at:
/data/data/{package name}/cache/
This commit is contained in:
@@ -168,7 +168,7 @@ public class Capture extends Plugin {
|
||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
|
||||
// Specify file so that large image is captured and returned
|
||||
File photo = new File(Environment.getExternalStorageDirectory(), "Capture.jpg");
|
||||
File photo = new File(DirectoryManager.getTempDirectoryPath(ctx), "Capture.jpg");
|
||||
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
|
||||
this.imageUri = Uri.fromFile(photo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user