在活动中显示转换后的文件

m.q*_*yum 9 java android

我正在android studio中开发一个视频转换器.我能够成功转换文件,并可以播放生成的文件:

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) {

}
Run Code Online (Sandbox Code Playgroud)

但我找不到任何代码来打开生成的文件夹并显示标记的转换文件.就像我们在windows中一样Locate file in folder.

Ali*_*Ali 4

这是打开转换后的文件所在文件夹的方法

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); 
Run Code Online (Sandbox Code Playgroud)