为什么在Android中使用Intent.ACTION_PICK时文件管理器App无法正常工作? [英] Why the file manager App didn't work when using Intent.ACTION_PICK in Android?
问题描述
我正在使用Android开发,并且想要实现一个文本文件选择.
I am developing in Android , and I want to implement a text file select.
我在Android手机中安装了es文件管理器应用程序.
I have install es file manager App in my Android phone.
我添加了权限:
<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 );
但是它没有打开文件管理器并列出我可以选择的文件.
But it didn't open the file manager and list the file let me choose.
我错过了什么吗?
谢谢.
推荐答案
Android默认文件管理器无法处理此Intent Intent.ACTION_GET_CONTENT
.您必须安装 es文件浏览器或类似文件文件管理器应用程序通过设备中的应用程序商店来打开该意图.
Android Default file manager cant handle this Intent Intent.ACTION_GET_CONTENT
. You have to install es file explorer or similar file manager apps form app store in your device to open that intent.
这篇关于为什么在Android中使用Intent.ACTION_PICK时文件管理器App无法正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!