Using Intent.ACTION_PICK for specific path
Asked Answered
S

2

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?

Sinfonietta answered 26/6, 2011 at 21:0 Comment(1)
i just answer this quest #6074770 may be it help you.Zwick
P
24

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.

Paduasoy answered 26/6, 2011 at 21:22 Comment(0)
J
0

Why not ?

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

Good luck with..

Jala answered 28/2, 2019 at 14:5 Comment(1)
Hello Taha. And welcome to StackOverflow. Remember to consider pointing the user to documentation or reasoning about your answer instead of just pasting code.Interlinear

© 2022 - 2024 — McMap. All rights reserved.