I'm developing a video converter in android studio. I'm able to convert file successfully and can play the resulting file with:
File file = new File(filepath);
Uri path = Uri.fromFile(file);
Intent Openintent = new Intent(Intent.ACTION_VIEW);
Openintent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Openintent.setDataAndType(path, "audio/mp3");
try {
startActivity(Openintent);
}
catch (ActivityNotFoundException e) {
}
But I can't find any code to open the resulting folder and show converted file marked. Like we have in windows Locate file in folder.
here is how you can open the containing folder for the converted file
String folderPath = filepath.substring(0 , filepath.lastIndexOf('/') + 1);
Uri uri = Uri.parse(folderPath);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, "resource/folder");
startActivity(intent);
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