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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

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