Dhaval2404/ImagePicker

Camera opens twice when "Don't keep activities" option is ON

benji101 opened this issue · 3 comments

Doing some tests while having the developer option "Don't keep activities" turned on (that simulates what could happen when low on memory). After taking a picture, the camera is started again. Taking a second picture, it now behave like it should. Please note that I'm using the cameraOnly() option.

I think the problem is that ImagePickerActivity, in its onCreate method, is not considering the savedInstanceState Bundle (which is not null if the activity has been destroyed and is being re-created). What I'm not sure is why it's working the second time, and not going on a loop.

Anyone else has this problem or can reproduce it?

@benji101 I'm able to reproduce the issue. I will try to fix this issue asap.
Thank you so much for the feedback.

@Dhaval2404 Thanks to you! I would have try to fix it myself, but I'm really busy at the moment, and I don't know Kotlin yet :(
Thanks for all the efforts you put in helping the community!

Greetings! The camera still opens twice for me (only on my physical device, on emulators it's all right). Is there anything I could provide to help track down the issue?