Android – use intent.action_ Pick to get a specific path

I'm trying to use the Android gallery to select pictures. It's easy to start the gallery

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

However, I need to limit the images displayed in the library to specific paths on the device (that is, only images from a single folder). Is this possible? How do you do it?

resolvent:

Sorry, no, it's impossible

You also have an error using this intent protocol http://developer.android.com/reference/android/content/Intent.html#ACTION_ Pick, this protocol expects you to place the content of the dataset you want the selector to select from: URI

That is, you should consider using action_ Pick. Modern action is action_ GET_ Content, which is better supported; You'll find action_ Pick supports instability and inconsistency. Unfortunately, action_ GET_ Content also does not allow you to specify a directory

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>