We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc91665 commit b19d02fCopy full SHA for b19d02f
app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MarshmallowCamera.kt
@@ -5,6 +5,7 @@ import android.content.Context
5
import android.hardware.camera2.CameraManager
6
import android.os.Build
7
import android.os.Handler
8
+import com.simplemobiletools.commons.extensions.showErrorToast
9
import com.simplemobiletools.flashlight.models.Events
10
import org.greenrobot.eventbus.EventBus
11
@@ -25,6 +26,7 @@ internal class MarshmallowCamera constructor(val context: Context) {
25
26
try {
27
manager.setTorchMode(cameraId!!, enable)
28
} catch (e: Exception) {
29
+ context.showErrorToast(e)
30
val mainRunnable = Runnable {
31
EventBus.getDefault().post(Events.CameraUnavailable())
32
}
0 commit comments