android - 为什么在Android中使用Intent.ACTION_PICK时文件管理器应用程序不起作用?

标签 android android-intent

我正在Android中开发,我想实现一个文本文件选择。

我已经在我的 Android 手机中安装了 es 文件管理器应用程序。

我添加权限:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> ,然后我尝试以下代码:

Intent intent = new Intent( Intent.ACTION_PICK );
intent.setType( "text/*" );
Intent destIntent = Intent.createChooser( intent, "Select File" );
startActivityForResult( destIntent, 0 );

但它没有打开文件管理器并列出文件让我选择。

我错过了什么吗?

提前致谢。

最佳答案

Android 默认文件管理器无法处理此 Intent Intent.ACTION_GET_CONTENT。您必须安装es file explorer或类似的文件管理器应用程序从您设备中的应用程序商店中打开该 Intent 。

关于android - 为什么在Android中使用Intent.ACTION_PICK时文件管理器应用程序不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31313460/

相关文章:

android - 从堆栈中删除 Activity

android - facebook 从 android 和网络服务器连接

android - 通过 WhatsApp 发送消息

java - Android - AlarmManager实例不会重复执行

Android - 计算原始文件中 .mp3 的数量

android - CollapsingToolbarLayout 在 android 中将 NestedScrollView 向下推

android - 以编程方式创建 LayerDrawable 对象

android - 如何在不打开其他使用 "geo"方案的应用程序的情况下打开 Google map ?

android - 未找到 startActivity 源

android - 单击通知并在android中启动应用程序