22
33A FileBrowser / FileChooser for Android that you can integrate to your app to browse/select files from internal/external storage.
44
5+ [ ![ Android Arsenal] ( https://img.shields.io/badge/Android%20Arsenal-Android--FileBrowser--FilePicker-brightgreen.svg?style=flat )] ( https://android-arsenal.com/details/1/5636 )
6+
57# Using Maven
68``` xml
79<dependency >
@@ -53,15 +55,15 @@ Use following Intent to start the FileChooser
5355``` java
5456Intent i2 = new Intent (getApplicationContext(), FileChooser . class);
5557i2. putExtra(Constants . SELECTION_MODE ,Constants . SELECTION_MODES. SINGLE_SELECTION. ordinal());
56- startActivityForResult(i2,PICK_CONTACT_REQUEST );
58+ startActivityForResult(i2,PICK_FILE_REQUEST );
5759```
5860
5961
6062To get the selected file, In your calling activity's onActivityResult method, use the following
6163
6264``` java
6365
64- if (requestCode == PICK_CONTACT_REQUEST && data!= null ) {
66+ if (requestCode == PICK_FILE_REQUEST && data!= null ) {
6567 if (resultCode == RESULT_OK ) {
6668 Uri file = data. getData();
6769 }
@@ -74,14 +76,14 @@ if (requestCode == PICK_CONTACT_REQUEST && data!=null) {
7476``` java
7577Intent i2 = new Intent (getApplicationContext(), FileChooser . class);
7678i2. putExtra(Constants . SELECTION_MODE ,Constants . SELECTION_MODES. MULTIPLE_SELECTION. ordinal());
77- startActivityForResult(i2,PICK_CONTACT_REQUEST );
79+ startActivityForResult(i2,PICK_FILE_REQUEST );
7880```
7981
8082To get the selected file, In your calling activity's onActivityResult method, use the following
8183
8284``` java
8385
84- if (requestCode == PICK_CONTACT_REQUEST && data!= null ) {
86+ if (requestCode == PICK_FILE_REQUEST && data!= null ) {
8587 if (resultCode == RESULT_OK ) {
8688 ArrayList<Uri > selectedFiles = data. getParcelableArrayListExtra(Constants . SELECTED_ITEMS );
8789 }
0 commit comments