Search code examples
androidandroid-intentintentfilter

Android get images from gallery


Intent intent = new Intent(Intent.ACTION_PICK);
    intent.setType("image/*");
    startActivityForResult(intent, SELECT_PICTURE);

I am using this intent to images from from gallery but sometimes it shows a different layout. it should be showing interface like this.

expected layout

but sometimes it shows this layout and asks to crop the image and i dont get a callback on my activity.

not expected layout

How can make the intent to get images only using the first layout?


Solution

  • it should be showing interface like this.

    There are ~2.5 billion Android devices, spread over >26,000 models. There are dozens, if not hundreds, of pre-installed apps that will respond to your Intent, across those device models. Additionally, there are dozens, if not hundreds, of user-installed apps that will respond to your Intent, installed on some of those billions of devices.

    Those apps can do what they want, and you do not control what those apps look like.