3

可能重复:
如何通过代码打开手机图库

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

4

2 回答 2

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);
于 2011-09-22T12:46:28.323 回答
2

试试这个打开画廊

Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);//
startActivityForResult(Intent.createChooser(intent, "Select Picture"),10);
于 2011-09-22T12:11:55.040 回答