Skip to content
Shows a DialogFragment with camera and gallery options. User can choose wich provider wants to pick images from. 📸 🖼️
Branch: master
Clone or download
jrvansuita Merge pull request #111 from PLPellegrini/master
Fix for newer Android versions.
Latest commit 4b4165f Sep 5, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Removing unused import Sep 26, 2018
gradle/wrapper Fixed gradle dependencies and imports to be compatible with AndroidX … Sep 26, 2018
images images Feb 7, 2017
library - Add support for Android Q Sep 5, 2019
.gitignore Add the whole .idea directory into .gitignore. May 3, 2018
LICENSE.txt License Nov 21, 2016
build.gradle Fixed gradle dependencies and imports to be compatible with AndroidX … Sep 26, 2018 Fixed gradle dependencies and imports to be compatible with AndroidX … Sep 26, 2018
gradlew Initial commit Nov 1, 2016
gradlew.bat Initial commit Nov 1, 2016
settings.gradle Initial commit Nov 1, 2016

Buy Me a Coffee at 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

Dialog screenshots

Default icons.

Colored icons.

Custom dialog.

System dialog. Demo Codacy Badge API


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

allprojects {
    repositories {
	maven { url "" }

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. 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). 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 =;

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
You can’t perform that action at this time.