How to add gallery button to Camera open with intent?

∥☆過路亽.° 提交于 2019-12-24 04:40:53

问题


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

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?


回答1:


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

Good Luck!




回答2:


If you really want to have a button that links to the gallery while the user is in the Camera view, then you probably will need to create a custom camera activity. Android docs has a good explanation of how to get started: http://developer.android.com/training/camera/cameradirect.html



来源:https://stackoverflow.com/questions/12483617/how-to-add-gallery-button-to-camera-open-with-intent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!