GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing raw.githubusercontent.com — raw.githubusercontent.com # Android-FilePicker
[](https://android-arsenal.com/details/1/4044)
[  ](https://bintray.com/droidninja/maven/com.droidninja.filepicker/_latestVersion)
A filepicker which allows to select images and videos with flexibility. It also supports selection of files by specifying its file type. Check out app module for example.



# Installation
* As of now, It is only available in jCenter(), So just put this in your app dependencies:
```gradle
compile 'com.droidninja:filepicker:2.1.2'
```
# Note
This Filepicker is based on the MediaStore api provided by android. It checks MediaStore database for a file entry. If your file is not showing in the picker, it means that it is not inserted into MediaStore database yet. There is method in `FilePickerUtils` class named `notifyMediaStore(Context context, String path)` through which you can notify the MediaStore database.
# Usage
Just include this in your onclick function:
* For **photopicker**:
```java
FilePickerBuilder.getInstance().setMaxCount(5)
.setSelectedFiles(filePaths)
.setActivityTheme(R.style.AppTheme)
.pickPhoto(this);
```
* For **document picker**:
```java
FilePickerBuilder.getInstance().setMaxCount(10)
.setSelectedFiles(filePaths)
.setActivityTheme(R.style.AppTheme)
.pickFile(this);
```
After this, you will get list of file paths in activity result:
```java
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode)
{
case FilePickerConst.REQUEST_CODE_PHOTO:
if(resultCode== Activity.RESULT_OK && data!=null)
{
photoPaths = new ArrayList<>();
photoPaths.addAll(data.getStringArrayListExtra(FilePickerConst.KEY_SELECTED_MEDIA));
}
break;
case FilePickerConst.REQUEST_CODE_DOC:
if(resultCode== Activity.RESULT_OK && data!=null)
{
docPaths = new ArrayList<>();
docPaths.addAll(data.getStringArrayListExtra(FilePickerConst.KEY_SELECTED_DOCS));
}
break;
}
addThemToView(photoPaths,docPaths);
}
```
# Builder Methods
**Android FilePicker** now has more flexibility. Supported builder methods are:
Method | Use
-------- | ---
setMaxCount(int maxCount) | used to specify maximum count of media picks (dont use if you want no limit)
setActivityTheme(int theme) | used to set theme for toolbar (must be an actionbar theme)
setSelectedFiles(ArrayList |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |