Search code examples
androidandroid-studioandroid-camera-intent

How to make the Camera stay opened in android studio?


So I have a Camera that the user can open and use to take pictures:

 public void launchCamera(View view){

    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    //Take picture and pass results along OnActivityResult
    startActivityForResult(intent,REQUEST_IMAGE_CAPTURE);
}

but the problem here is that I allow people to take many pictures or a single picture, but it gets tedious to keep forcing the user to take a picture then leave to Activity then he has to press the camera button again and take another image,so my question is, is it possible to keep the Camera opened and still allow the user to get many pictures without having to get back to the activity and then after he finishes he clicks finish and goes back to the activity.


Solution

  • is it possible to keep the Camera opened and still allow the user to get many pictures without having to get back to the activity and then after he finishes he clicks finish and goes back to the activity.

    Not using ACTION_IMAGE_CAPTURE, sorry. You can write your own camera code, using the relevant APIs or a third-party library (e.g., Fotoapparat, CameraKit-Android).