Why the file manager App didn't work when usin

2019-07-14 14:19发布

问题:

I am developing in Android , and I want to implement a text file select.

I have install es file manager App in my Android phone.

I add the permission :

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> , and I try the following code:

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.

Did I missing something ?

Thanks in advance.

回答1:

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.