Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we use Intent.EXTRA_ALLOW_MULTIPLE for older versions of Android API levels using Android Support Library?

According to Intent.EXTRA_ALLOW_MULTIPLE documentation:

Used to indicate that a ACTION_GET_CONTENT intent can allow the user to select and return multiple items. This is a boolean extra; the default is false. If true, an implementation of ACTION_GET_CONTENT is allowed to present the user with a UI where they can pick multiple items that are all returned to the caller. When this happens, they should be returned as the getClipData() part of the result Intent.

So we can use it as:

startActivityForResult(new Intent(Intent.ACTION_GET_CONTENT).putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true).setType("image/*");

But this is available for Android API 18+ only.

So my question is can we use it for older versions of Android API levels using Android Support Library?

If yes, How?

like image 389
krishh Avatar asked Sep 28 '13 16:09

krishh


2 Answers

can we use it for older versions of Android API levels using Android Support Library?

No, we can't, Intent.EXTRA_ALLOW_MULTIPLE is not included in the Android Support Library, at least at this moment.

like image 70
Andy Res Avatar answered Nov 05 '22 16:11

Andy Res


I'm afraid you can not use it before API 16. Because to use this you will be required to call getClipData() to get multiple paths/URIs, getClipData was added in API 16. But its better to use from API 18.

like image 2
xmen Avatar answered Nov 05 '22 15:11

xmen