Android open camera from button

前端 未结 10 1595
無奈伤痛
無奈伤痛 2020-11-29 03:24

I hope this isn\'t a duplicate question but I am making an app that I want a button to open the camera app (the default android camera separately). How do I got about doing

10条回答
  •  悲&欢浪女
    2020-11-29 04:01

    You are correct about the action used in Intent but it's not the only thing you have to do. You'll also have to add

    startActivityForResult(intent, YOUR_REQUEST_CODE);
    

    To get it all done and retrieve the actual picture you could check the following thread.

    Android - Capture photo

提交回复
热议问题