简体   繁体   中英

How to read external directory android?

I am saving an image like this

  File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM); File file = new File(path2, "new-photo-name.jpg"); outputFileUri = Uri.fromFile(file); intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri); cameraIntents.add(intent); 

Basically, the image is saved in the pictures folder. My question is how can I read this image later new-photo-name.jpg

you can get the file path by:

String imgPath = file.getAbsolutePath();

then next time make you can access the file by this path or make new file by this path

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM