Committed by
GitHub
Merge pull request #27 from myoganugraha/fix-force-close-issue-after-permission-request
Call cameraProvider.unbindAll() before create preview
Showing
1 changed file
with
1 additions
and
0 deletions
| @@ -136,6 +136,7 @@ class MobileScanner(private val activity: Activity, private val textureRegistry: | @@ -136,6 +136,7 @@ class MobileScanner(private val activity: Activity, private val textureRegistry: | ||
| 136 | 136 | ||
| 137 | future.addListener({ | 137 | future.addListener({ |
| 138 | cameraProvider = future.get() | 138 | cameraProvider = future.get() |
| 139 | + cameraProvider!!.unbindAll() | ||
| 139 | textureEntry = textureRegistry.createSurfaceTexture() | 140 | textureEntry = textureRegistry.createSurfaceTexture() |
| 140 | 141 | ||
| 141 | // Preview | 142 | // Preview |
-
Please register or login to post a comment