android - Detect when another app tries to use the camera -


our app runs background service, continuously getting images frontal camera , doing things images. however, when user tries open app uses camera, 2 things happen: either new app crashes , ours continues, or our crashes , new 1 gets access camera.

now, if our app loses control on camera, there's exception can catch, , can start trying access until access , things go normal.

the problem when other apps crash because of ours. there way detect this, can pause our app until can access camera again?

this happens because camera exclusive resource.

i recommend read camera documentation, says:

if application not release camera, subsequent attempts access camera, including own application, fail , may cause or other applications shut down.


Comments