How can I free the camera when another application asks for it?

I have two applications that use the camera:

  • The flashlight app that I developed
  • Camera app

The flashlight application opens the camera, turns on the flash and works in the background. However, if you start the camera application while turning on the flashlight, an error appears in the camera application, since the camera is already in use by the flashlight application:

Unable to get device

In a flashlight application, how can I free the camera when another application requests it?

+4
source share
1 answer

, onPause. Camera.release(), . onResume().

-1

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


All Articles