I would like to start an intentchooser which can return any kind of file. The following code works with the usual file explorers (ES, Astro, etc.) but not with the built-in samsung My Files explorer.
Intent selectFile = new Intent(Intent.ACTION_GET_CONTENT);
selectFile.setType("file/*");
startActivityForResult(Intent.createChooser(selectFile, "Select File"), SELECT_FILE);
Does anyone know how to handle that samsung explorer? I tried to use Intent selectFile = new Intent( "com.sec.android.app.myfiles.PICK_DATA") but it doesn't seem to work.
Any ideas? Thanks.
Update: I used this code
Intent selectFile = new Intent();
selectFile.setAction("com.sec.android.app.myfiles.PICK_DATA");
startActivityForResult(selectFile, SELECT_FILE);
but I get this error: FORWARD_RESULT_FLAG used while also requesting a result. Anyone know what does this mean?
Intent samsungIntent = new Intent();
samsungIntent.setAction("com.sec.android.app.myfiles.PICK_DATA");
samsungIntent.putExtra("CONTENT_TYPE", "*/*");
Changing from setType to putExtra does the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With