如何将图库意图中的 'open' 更改为 'done'?
How to change 'open' in gallery intent to 'done'?
我正在使用以下意图打开图库以选择多个图像和视频:
Intent intent = new Intent();
intent.setType("image/* video/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Images"), MULTIPLE_IMAGE_SELECT);
画廊打开后看起来像
顶部显示 'open' 我想将其更改为 'done' 或 'ok',如何实现?
谢谢
编辑:将 "images/*"
更改为 "image/*"
更改此行intent.setType("video/*, image/*");
Intent intent = new Intent();
intent.setType("video/*, image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Images"), MULTIPLE_IMAGE_SELECT);
注意:EXTRA_ALLOW_MULTIPLE 选项仅适用于 Android API 18 及更高版本。
可以使用自定义库。喜欢:
When the gallery is opened it looks like
大约有 20 亿 Android 台设备,分布在数千种设备型号中。您的 Intent
将打开安装在这些设备上的可能的 Android 个应用程序,即使不是数千个,也可能是数百个之一。它与 "gallery" 没有任何具体关系,当然也与屏幕截图中的任何特定应用程序无关。当您 运行 您的代码在一台特定设备上时,恰好会出现这种情况。
how to achieve that?
您自己编写 UI,而不是将其委托给其他人的应用程序。您无法控制其他开发者应用的 UI。
正如 Ahmad 指出的那样,有很多 image picker libraries。也许你可以使用一个。
我正在使用以下意图打开图库以选择多个图像和视频:
Intent intent = new Intent();
intent.setType("image/* video/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Images"), MULTIPLE_IMAGE_SELECT);
画廊打开后看起来像
顶部显示 'open' 我想将其更改为 'done' 或 'ok',如何实现? 谢谢
编辑:将 "images/*"
更改为 "image/*"
更改此行intent.setType("video/*, image/*");
Intent intent = new Intent();
intent.setType("video/*, image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Images"), MULTIPLE_IMAGE_SELECT);
注意:EXTRA_ALLOW_MULTIPLE 选项仅适用于 Android API 18 及更高版本。
可以使用自定义库。喜欢:
When the gallery is opened it looks like
大约有 20 亿 Android 台设备,分布在数千种设备型号中。您的 Intent
将打开安装在这些设备上的可能的 Android 个应用程序,即使不是数千个,也可能是数百个之一。它与 "gallery" 没有任何具体关系,当然也与屏幕截图中的任何特定应用程序无关。当您 运行 您的代码在一台特定设备上时,恰好会出现这种情况。
how to achieve that?
您自己编写 UI,而不是将其委托给其他人的应用程序。您无法控制其他开发者应用的 UI。
正如 Ahmad 指出的那样,有很多 image picker libraries。也许你可以使用一个。