Visit GitHub RepoImage Pickers

Buy Me a Coffee at ko-fi.com Get it on Google Play


This is an Android project. It shows a DialogFragment with Camera or Gallery options. The user can choose from which provider wants to pick an image.

JitPack Android Arsenal MaterialUp ghit.me

Dialog screenshots

Default icons.

Colored icons.

Custom dialog.

System dialog.

Appetize.io Demo Codacy Badge API


Step #1. Add the JitPack repository to your build file:

allprojects {
    repositories {
	maven { url "https://jitpack.io" }

Step #2. Add the dependency (See latest release).

dependencies {
    compile 'com.github.jrvansuita:PickImage:+'


Step #1. Overriding the library file provider authority to avoid installation conflicts.

The use of this library can cause INSTALL_FAILED_CONFLICTING_PROVIDER if you skip this step. Update your AndroidManifest.xml with this exact provider declaration below.

<manifest ...>
    <application ...>
                android:resource="@xml/picker_provider_paths" />

Step #2 - Showing the dialog.

PickImageDialog.build(new PickSetup()).show(this);

Step #3 - Applying the listeners.

Method #3.1 - Make your AppCompatActivity implements IPickResult.
public void onPickResult(PickResult r) {
    if (r.getError() == null) {
        //If you want the Uri.
        //Mandatory to refresh image from Uri.

        //Setting the real returned image.

        //If you want the Bitmap.

        //Image path
    } else {
        //Handle possible errors
        //TODO: do what you have to do with r.getError();
        Toast.makeText(this, r.getError().getMessage(), Toast.LENGTH_LONG).show();
Method #3.2 - Set the listener using the public method (Good for Fragments).
PickImageDialog.build(new PickSetup())
               .setOnPickResult(new IPickResult() {
                  public void onPickResult(PickResult r) {
                     //TODO: do what you have to...
	       .setOnPickCancel(new IPickCancel() {
		  public void onCancelClick() {
			//TODO: do what you have to if user clicked cancel

Step #4 - Customize you Dialog using PickSetup.

PickSetup setup = new PickSetup()
            .setPickTypes(EPickType.GALLERY, EPickType.CAMERA)
/*... and more to come. */


Own click implementations.

If you want to write your own button click event, just use IPickClick listener like in the example below. You may want to take a look at the sample app.

        .setOnClick(new IPickClick() {
            public void onGalleryClick() {
                Toast.makeText(SampleActivity.this, "Gallery Click!", Toast.LENGTH_LONG).show();

            public void onCameraClick() {
                Toast.makeText(SampleActivity.this, "Camera Click!", Toast.LENGTH_LONG).show();

For dismissing the dialog.

PickImageDialog dialog = PickImageDialog.build(...);

Force a specific width and height.

new PickSetup().setWidth(600).setHeight(800);

Not just an ImagePicker anymore! You can pick video too.

You can tell the setup to pick video instead of photo! (default option if you don't mention is to pick Image)

new PickSetup().setVideo(true);

Sample app code.

You can take a look at the sample app located on this project.

Google+ LinkedIn Instagram Github Google Play Store E-mail
Become a better Android Developer
Millions of developers are learning at MindOrks

Online Training Program

Featured Blogs

Our Team

MindOrks is Certainly one of the best online blog to stay on top of all the Android development news, coding and design patterns. Finally a blog I can count on to keep myself updated with latest and greatest things happening in Android world.

Vipul Shah
Android Developer

Become Pro in Android by watching videos