This library makes it simple.
Just Call:
PickImageDialog.on(MainActivity.this, new PickSetup(BuildConfig.APPLICATION_ID));
Then make your Activity implement IPickResult and override this below method.
@Override
public void onPickResult(PickResult r) {
if (r.getError() == null) {
imageView.setImageBitmap(r.getBitmap());
//or
imageView.setImageURI(r.getUri());
} else {
//Handle possible errors
//TODO: do what you have to do with r.getError();
}
}