mirror of
https://github.com/apache/cordova-plugin-camera.git
synced 2025-01-31 12:42:50 +08:00
Merge pull request #588 from purplecabbage/AndroidCacheLocal
[Android] Cache images in device storage, devices have enough space now.
This commit is contained in:
commit
e9aba07926
@ -220,17 +220,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
|
|||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
|
||||||
private String getTempDirectoryPath() {
|
private String getTempDirectoryPath() {
|
||||||
File cache = null;
|
File cache = cordova.getActivity().getCacheDir();
|
||||||
|
|
||||||
// SD Card Mounted
|
|
||||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
|
||||||
cache = cordova.getActivity().getExternalCacheDir();
|
|
||||||
}
|
|
||||||
// Use internal storage
|
|
||||||
else {
|
|
||||||
cache = cordova.getActivity().getCacheDir();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create the cache directory if it doesn't exist
|
// Create the cache directory if it doesn't exist
|
||||||
cache.mkdirs();
|
cache.mkdirs();
|
||||||
return cache.getAbsolutePath();
|
return cache.getAbsolutePath();
|
||||||
|
Loading…
Reference in New Issue
Block a user