我有一个意图,可用于允许用户选择图像应用程序中的某些图像,如厨房(或用户设备中的任何其他)。设置意图返回的项目的最大数量
我想让用户选择只有10张图片但我不知道如何设置这个最大意图。 我试图看看我是否可以使用ClipData,但clipdata没有方法来设置最大数量的项目。
ClipboardManager manager = getSystemService(Context.CLIPBOARD_SERVICE)
ClipData clipdata = manager.getPrimaryClip();// in short whether i get
or i create a clipdata, there are no methods to set maximum number of
items to be held into that clip
这是我的意图。
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
photoPickerIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
photoPickerIntent.setType("image/*");
startActivityForResult(photoPickerIntent, SELECT_PHOTO);
我怎么能限制用户只能选择10张照片?
它似乎只限于厨房应用程序。不是吗? –
使用此库它会从设备的所有图像。我们可以限制选择图像。它不仅限于画廊应用 – Venkatesh
我要测试它并告诉你结果。我看到这个库有很多问题,包括github上的内存问题。 –