3

I am trying to use Android gallery to pick image. Launching gallery is easy for that purpose

Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
photoPickerIntent.setType("image/*");
startActivityForResult(photoPickerIntent, 1);

However, I need to limit images that are shown in the gallery to specific path on device (i.e. to show images from single folder only). Is this possible to do and how?

dstefanox
  • 2,222
  • 3
  • 19
  • 21
  • i just answer this quest http://stackoverflow.com/questions/6074270/built-in-gallery-in-specific-folder/8255674#8255674 may be it help you. – PiyushMishra Nov 24 '11 at 11:37

2 Answers2

23

Sorry, no this is not possible.

Also you are using this Intent protocol wrong. As per http://developer.android.com/reference/android/content/Intent.html#ACTION_PICK this protocol expects that you put the content: URI of the data set you want the picker to select from.

That said, you should consider ACTION_PICK deprecated. The modern action is ACTION_GET_CONTENT which is much better supported; you will find support of ACTION_PICK spotty and inconsistent. Unfortunately, ACTION_GET_CONTENT also does not let you specify a directory.

CopsOnRoad
  • 237,138
  • 77
  • 654
  • 440
hackbod
  • 90,665
  • 16
  • 140
  • 154
0

Why not ?

    Intent galleryIntent = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivity(galleryIntent)

Good luck with..

  • Hello Taha. And welcome to StackOverflow. Remember to consider pointing the user to documentation or reasoning about your answer instead of just pasting code. – Panthro Feb 28 '19 at 14:12