I have selected a file from a folder on the SD card, now I want to get that path without the file name attached, here is the code to how I am doing it:
currImageURI = data.getData();
String name=getRealPathFromURI(currImageURI);
now name stores all the path like /mnt/sdcard/images/photo1.jpg. I want to remove photo1.jpg form this path, need help with this aspect thanks.
Use this:
String path = new File(name).getParent();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With