android - Select File from file manager via Intent -


what wanna do:

i wanna path string of file, choose via android file manager.

what have:

intent intent = new intent(intent.action_get_content); intent.settype("*/*"); startactivityforresult(intent.createchooser(intent, "open ..."), file_select_code); 

this code, works fine me, there 1 problem. can select file following apps:

enter image description here

my question:

does have working code choosing file via android file manager?

use this:

    intent intent = new intent(intent.action_open_document);     intent.addcategory(intent.category_openable);     intent.settype("*/*");      startactivityforresult(intent, request_code); 

for samsung devices open file manager use this:

intent intent = new intent("com.sec.android.app.myfiles.pick_data"); intent.putextra("content_type", "*/*"); intent.addcategory(intent.category_default); 

for more reference checkout http://developer.android.com/guide/topics/providers/document-provider.html


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -