question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fatal exception when torch is clicked on a device which has no flashlight.

See original GitHub issue

java.lang.RuntimeException: setParameters failed E/AndroidRuntime(24312): at android.hardware.Camera.native_setParameters(Native Method) E/AndroidRuntime(24312): at android.hardware.Camera.setParameters(Camera.java:2162) E/AndroidRuntime(24312): at com.uuzuche.lib_zxing.activity.CodeUtils.isLightEnable(CodeUtils.java:211) E/AndroidRuntime(24312): at com.shinow.qrscan.SecondActivity$1.onClick(SecondActivity.java:75) E/AndroidRuntime(24312): at android.view.View.performClick(View.java:7346) E/AndroidRuntime(24312): at android.view.View.performClickInternal(View.java:7312) E/AndroidRuntime(24312): at android.view.View.access$3200(View.java:846) E/AndroidRuntime(24312): at android.view.View$PerformClick.run(View.java:27801) E/AndroidRuntime(24312): at android.os.Handler.handleCallback(Handler.java:873) E/AndroidRuntime(24312): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(24312): at android.os.Looper.loop(Looper.java:214) E/AndroidRuntime(24312): at android.app.ActivityThread.main(ActivityThread.java:7156) E/AndroidRuntime(24312): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(24312): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) E/AndroidRuntime(24312): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975) I/Process (24312): Sending signal. PID: 24312 SIG: 9 Lost connection to device.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Cybernetics354commented, Dec 8, 2020

im ended up fork and change the java codes by myself, and i add some try catch on turn on/off callback so i can handle if there’s exception occured.

file on SecondActivity.java

try {
  CodeUtils.isLightEnable(true);
  isLightOpen = true;
} catch (Exception e) {
  // Exception handler here
  Toast.makeText(getApplicationContext(), "Tidak bisa menyalakan senter", Toast.LENGTH_SHORT).show();
}
0reactions
Cybernetics354commented, Dec 8, 2020

yeah i think so, in case you want to fix this issue ASAP, you can use that alternative. i’ve made a pull request for this. but i can’t wait for the maintainer accept this so right now im using custom fork until it accepted or fixed by them.

and also sorry for my bad english 😊

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android flashlight on nexus 5 - java - Stack Overflow
I'm trying to develop an application for to turn on the flashlight on click in a toggle. I tried every method I found...
Read more >
Android Flashlight Not Working? Here are 6 Possible Solutions
Android Flashlight Not Working? Here are 6 Possible Solutions · 1. Restart the phone · 2. Delete Camera app data · 3. Try...
Read more >
Why my iPhone Flashlight is Disabled (how to fix) - YouTube
So hopefully, these methods will allow you to solve the problems you have with the flashlight on your iPhone not turning on.
Read more >
Android Flashlight Not Working - Fix!!! - YouTube
You can try restarting your phone, going into the settings, and reset your camera app cache, also downloading and installing a new torch...
Read more >
Rear Camera and Flashlight Not Working | XDA Forums
Sometime in the past week or so, my rear camera stopped working completely. The flashlight won't work either. At first, I thought it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found