Using Intent.ACTION_PICK for a specific path

I am trying to use the Android gallery to select an image. Running the gallery is easy for this.

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

However, I need to limit the images displayed in the gallery to a specific outline on the device (i.e. show images from only one folder). Can this be done and how?

+2
android gallery
Jun 26 '11 at 21:00
source share
1 answer

Sorry, this is not possible.

Also, you are misusing this Intent protocol. According to http://developer.android.com/reference/android/content/Intent.html#ACTION_PICK , this protocol assumes that you put the contents: URI of the data set that you want to select from the selection.

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

+21
Jun 26 2018-11-21T00:
source share



All Articles