Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android How to view doc from sdcard in gallary?

I have app in which user can search image,audio,video,doc file from sdcard and choose 1 file for upload it on server. Using Below code I can open the gallery and select image,audio,video But I have not idea that how to search doc from gallery.

Here is my code.

    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_GET_CONTENT);
    //intent.setType("video/*");
    //intent.setType("audio/*");
    //intent.setType("image/*");
    //**What I have to do for view document[.pdf/text/doc] file**
    startActivityForResult(Intent.createChooser(intent, "Complete action using"), REQUEST_CODE);

Does anyone have any idea how this can be achieved? Any help is greatly appreciated.

like image 676
Nik88 Avatar asked Nov 13 '22 05:11

Nik88


1 Answers

try this library aFileChooser its working fine

pls see this link

like image 89
Anil M H Avatar answered Nov 16 '22 02:11

Anil M H