Get current camera photo folder

I have a small FileExplorer in my application and I want it to run in the folder that is currently used by the defautl camera. Is there any way to get this way? I tried:

Environment.getExternalStoragePublicDirectory (Environment.DIRECTORY_PICTURES).getAbsolutePath()); 

But this does not return "/ mnt / sdcard / Pictures", and my camera is stored in "mnt / sdcard / ext_sd / DCIM / 100MEDIA /"

PS: I know how to start the camera with a specific folder for storing images, which is not what I'm looking for,

+8
android camera
source share
1 answer
 String[] projection = new String[]{MediaStore.Images.ImageColumns._ID,MediaStore.Images.ImageColumns.DATA,MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME,MediaStore.Images.ImageColumns.DATE_TAKEN,MediaStore.Images.ImageColumns.MIME_TYPE}; final Cursor cursor = managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,projection, null, null, MediaStore.Images.ImageColumns.DATE_TAKEN + " DESC"); if(cursor != null){ cursor.moveToFirst(); // you will find the last taken picture here // according to Bojan Radivojevic Bomber comment do not close the cursor (he is right ^^) //cursor.close(); } 
+4
source share

All Articles