Android 画廊选择像 Whatsapp

标签 android android-intent gallery whatsapp

以前有人问过这个问题,但恐怕答案可能已经过时了。 我如何使用原生图库应用程序(比如 API 14 on)来实现像 WhatsApp 一样的多图像选择?

最佳答案

你的意思是:

Intent intent = new Intent();
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Picture"), 1);

注意:EXTRA_ALLOW_MULTIPLE 选项仅在 Android API 18 及更高版本中可用。

此链接讨论 creating custom image picker with multiple select.

关于Android 画廊选择像 Whatsapp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25698815/

相关文章:

java - 在 Android Studio 中将事件添加到 Google 日历

android - onActivityResult 方法未被调用 Android

java - SqlDelight 不为 SQL 语句生成 SQL 查询字符串

android - 带有 CardView 的 StaggeredGridLayoutManager 不适合项目测量

android - 强制相机始终在 android 中以纵向模式打开

Android Intent 导致 NoClassDefFoundError

Android - 从图库加载图像并设置为背景

android - 触发android图像选择器 Intent 时仅从图库中检索图像

android - 使用数据创建快捷方式

android - 保存从画廊中挑选的图像以备将来使用