-1

I am using the following code to pick images.

Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
    photoPickerIntent.setType("image/*");
    photoPickerIntent.setData(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
    startActivityForResult(Intent.createChooser(photoPickerIntent, getActivity().getResources().getString(R.string.select_picture)), 1);

Its working fine but it only let me to choose images from default Photos application. I want to pick images from "Gallery" application even in today's latest devices. I don't know how WhatsApp is doing this even for Lollipop.

Ali Ansari
  • 219
  • 3
  • 14

1 Answers1

0

I am using This code in my app and it works fine for me..

intent = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
        intent.setType("image/* video/*");
        startActivityForResult(intent, 3);
Trusha Savsani
  • 489
  • 1
  • 11
  • 31