【发布时间】:2018-07-31 10:26:34
【问题描述】:
我生成了一个文件夹名称“tesApplication”并在其中创建一个文件名“testFile.csc”并将一些日期存储到该文件中。现在我想使用新意图打开文件夹目录。 我尝试了下面的代码,但在我的情况下没有任何其他方式来实现这一点。
Uri selectedUri = Uri.parse(fileNameString);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(selectedUri, "text/csv");
if (intent.resolveActivityInfo(getPackageManager(), 0) != null)
{
startActivity(intent);
}
else
{
// if you reach this place, it means there is no any file
// explorer app installed on your device
}
【问题讨论】:
-
你想要的东西是不可能的。 Android 不提供此选项。