如何在安卓默认相册中打开图片

3
我在我的应用程序中输出了一张图片。我能否调用默认的Android图库来显示该图像,而不是使用ImageView查看该图像。 非常感谢!

我想使用Android系统中的默认图像查看器,因为我想要使用查看器的某些功能。可以跳过进入图库并进入默认图像查看器。 - newstartgirls
2个回答

2

尝试使用此方法打开图库

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

2
你应该能够使用以下代码在画廊中显示图像。
Intent intentquick = new Intent(Intent.ACTION_VIEW);
intentquick.setDataAndType(<full path to image to be displayed>,"image/*");

intentquick.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intentquick);

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接