I have looked into other camera flashlight related problems in stackoverflow, but couldn't find an answer that solves my issue. The flashlight flashes for 6-8 times and then the app crashes. Here I have a blink()
method that calls cameraon()
and cameraoff()
in a loop. Could you please let me know where I went wrong?
My code can be found here: http://pastebin.com/3LRMwd1J
The logcat output can be see here: http://pastebin.com/2GTpn8Ux
I have tried using surface textures, tried to include Thread.sleep()
in betweencameraon()
and cameraoff()
but so far no luck.
I use Android 4.4 with latest sdk and jdk versions. I use nexus 5 for testing.
Thanks in advance!