我正在制作视频播放器应用程序。而且我想添加选项,例如,当用户点击时,它会打开默认文件管理器以显示此视频文件的位置。
任何帮助,将不胜感激 !
你可以通过这个方法做到这一点。
public void open_Folder(String location)
{
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath()
+ File.separator+ location + File.separator);
intent.setDataAndType(uri, "set your data type");
startActivity(Intent.createChooser(intent, "Select file manager app."));
}