从Gallery android中选择“仅图像”
我正在使用以下代码打开Gallery进行图像选择从Gallery android中选择“仅图像”,android,android-intent,android-gallery,Android,Android Intent,Android Gallery,我正在使用以下代码打开Gallery进行图像选择 private void galleryIntent() { Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI); intent.setType("image/*"); startActivityForResult(Intent.createChooser(inten
private void galleryIntent() {
Intent intent = new Intent(Intent.ACTION_PICK,
MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
intent.setType("image/*");
startActivityForResult(Intent.createChooser(intent, getResources().getString(R.string.select_file)), SELECT_FILE);
一切正常,但第一次出现了一个带有两个选项的弹出窗口:
我可以让我的应用程序始终直接打开多媒体资料而不弹出任何此类窗口吗?
谢谢每个gallery应用程序都有自己的软件包名称,不同设备的软件包名称可能有所不同。要执行所需操作,您必须知道gallery应用程序的程序包名称。某些设备甚至可能没有默认的多媒体资料应用程序 您所做的是正确的,用户可以决定将gallery应用程序设置为默认应用程序。除非出于非常重要或特定的原因,给用户选择更为合理
请看每个gallery应用程序都有自己的程序包名称,不同设备的程序包名称可能不同。要执行所需操作,您必须知道gallery应用程序的程序包名称。某些设备甚至可能没有默认的多媒体资料应用程序 您所做的是正确的,用户可以决定将gallery应用程序设置为默认应用程序。除非出于非常重要或特定的原因,给用户选择更为合理 看看这个
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),
PICK_IMAGE_REQUEST);
Intent intent = new Intent();
intent.setType("image/*");
startActivity(intent);
试试这个
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),
PICK_IMAGE_REQUEST);
Intent intent = new Intent();
intent.setType("image/*");
startActivity(intent);
试试这个:-
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("content://media/internal/images/media"))
startActivity(intent);
或者你可以试试这个
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),
PICK_IMAGE_REQUEST);
Intent intent = new Intent();
intent.setType("image/*");
startActivity(intent);
试试这个:-
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("content://media/internal/images/media"))
startActivity(intent);
或者你可以试试这个
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),
PICK_IMAGE_REQUEST);
Intent intent = new Intent();
intent.setType("image/*");
startActivity(intent);
在安卓10上,一个带有动作的意图打开了图库
Intent().apply {
action = Intent.ACTION_PICK
type = "image/*"
}
当带有操作的意图\u获取\u内容打开文件选择器时
Intent().apply {
action = Intent.ACTION_GET_CONTENT
type = "image/*"
}
在安卓10上,一个带有动作的意图打开了图库
Intent().apply {
action = Intent.ACTION_PICK
type = "image/*"
}
当带有操作的意图\u获取\u内容打开文件选择器时
Intent().apply {
action = Intent.ACTION_GET_CONTENT
type = "image/*"
}
startActivityForResult(意向);为什么你认为你的用户想要使用你认为“画廊”是什么?如果用户有另一个支持从
MediaStore
拾取图像的活动,让他们使用它。startActivityForResult(Intent);为什么你认为你的用户想要使用你认为“画廊”是什么?如果用户有另一个活动支持从MediaStore
中拾取图像,让他们使用它。这将为我打开Androidit works的文件资源管理器,这将只打开你设备的每个图像n个图像…这将为我打开Androidit works的文件资源管理器,这将只打开你设备的每个图像n个图像。。。