Mahdi Moqadasi
Mahdi Moqadasi

Reputation: 2479

What is the full list of extras for Intent.ACTION_PICK?

I recently started to use intent to pick and crop images. I found out that in addition of using libraries, it can be done with Intents. So here is my code to pick one:

Intent photoPickerIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
photoPickerIntent.setType("image/*");
photoPickerIntent.putExtra("crop", "true");
photoPickerIntent.putExtra("return-data", true);
photoPickerIntent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
photoPickerIntent.putExtra("aspectX", 1);
photoPickerIntent.putExtra("aspectY", 1);
startActivityForResult(photoPickerIntent, REQ_SELECT_IMG);

I founded this ACTION_PICK, but there is no documents for extras that can be sent to OS. Does any body knows the full list of these extras? Thanks in advance.

Upvotes: 0

Views: 666

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006674

it can be done with Intents.

Not reliably.

So here is my code to pick one

That will not perform a cropping operation on millions of Android devices, as there is no requirement for any Android device to have an ACTION_PICK activity for MediaStore.Images.Media.EXTERNAL_CONTENT_URI that supports those undocumented, unsupported extras.

Even for the subset of devices that happen to pay attention to some of those extras:

  • You do not know what will be done with those extras
  • You do not know what the resulting UI will be like for the user
  • You do not know how the results will be delivered, what format they will be in, etc.

I founded this ACTION_PICK, but there is no documents for extras that can be sent to OS

That is because there are none that are part of the Android SDK.

Does any body knows the full list of these extras?

There would need to be a list per device model, for over 20,000 device models. We have a difficult enough time getting manufacturers to support the documented Intent extras, let alone undocumented ones.

Please use a cropping library, rather than rely upon undocumented, unsupported Intent extras that will deliver unpredictable results.

Upvotes: 1

Related Questions