如何在意图打开的相机中添加图库按钮? [英] How to add gallery button to Camera open with intent?

查看:153
本文介绍了如何在意图打开的相机中添加图库按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用中,用户可以使用相机拍摄照片.我使用意图启动它:

In my app users are able to make a photo with camera. And I start it using intents:

Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);

现在,当打开的相机缺少图库按钮时,该按钮将允许用户从其SD卡中选择现有图像之一.是否可以显示此按钮?

Now when open camera lacks the gallery button which would allow user to pick one of existing images from his SD card. Is it possible to show this button?

推荐答案

您无法真正更改相机意图提供的功能,如果您找到了可以让相机应用程序访问图库的设备,我不会不依赖它.

You can't really change the things camera intent has to offer, and if you do find a device where the camera app would let you access the gallery I wouldn't depend on it.

我建议,只要您的用户点击按钮或启动相机意图"之类的按钮,就启动一个对话框,要求您选择新照片"或现有照片".如果他们选择现有的,请启动图库意图.

I would recommend that whenever your user taps on the button or whatever launches the Camera Intent, launch a dialog that asks you the user to choose, "New Photo" or "Existing Photo". If they choose existing, launch the gallery intent.

这是一个关于画廊意图的非常好的教程.

Here is a really good tutorial for the gallery intent.

http://www.helloandroid.com/tutorials/gallery-intent-tutorial

祝你好运!

这篇关于如何在意图打开的相机中添加图库按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆