Skip to content

Commit f66629f

Browse files
authored
Update README.md
Added Initial Directory Loading and File Extension Filtering Code Snippets
1 parent 4a73d82 commit f66629f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,22 @@ and in the broadcast receiver use the following to get the extras
136136
Bundle b = intent.getExtras()
137137
```
138138

139+
### To load a particular directory instead of the normal root directory
140+
Add the following in the intent
141+
``` java
142+
Intent i = new Intent(this, FileBrowser.class); //works for all 3 main classes (i.e FileBrowser, FileChooser, FileBrowserWithCustomHandler)
143+
i.putExtra(Constants.INITIAL_DIRECTORY, new File(Environment.getExternalStorageDirectory().getAbsolutePath(),"Movies").getAbsolutePath());
144+
```
145+
146+
147+
### To list only the files with a particular extension
148+
Add the following in the intent
149+
``` java
150+
Intent i = new Intent(this, FileBrowser.class); //works for all 3 main classes (i.e FileBrowser, FileChooser, FileBrowserWithCustomHandler)
151+
i.putExtra(Constants.ALLOWED_FILE_EXTENSIONS, "mkv;mp4;avi");
152+
```
139153

154+
Use file extensions delimited by semicolon
140155

141156
If you have any questions/queries/Bugs/Hugs please mail @
142157
adityak368@gmail.com

0 commit comments

Comments
 (0)