开发者

How to open the image in the Android's default gallery [duplicate]

开发者 https://www.devze.com 2023-04-06 21:40 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: How to open phones gallery through code
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How to open phones gallery through code

I have outputted a image in my app. Can I call the default Android's gallery to display the image instead o开发者_运维技巧f using ImageView to view the image. Thank you very much!


try this for open gallery

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


You should be able to display the image in gallery using this code..

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号