How to get a series of paintings?

I have problems with this, lately I also have a problem with just taking 1 photo ... do you know how to solve it? any working code?

I do it like this:

            mCamera = Camera.open();
    Log.e(TAG, "onCreate");
    mCamera.takePicture(null, mPictureCallback, mPictureCallback);

            Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() {
    public void onPictureTaken(byte[] imageData, Camera c) 
    {
        if (imageData != null) {
            //process photo
        }               
        }
};

in onDestroy () I release the camera

it works on the simulator, on the phone - for the first time it runs without problems, but there is no picture, the second and next time - "closing force" - it looks like the camera is not released ...

+3
source share

Source: https://habr.com/ru/post/1747090/


All Articles