fix: Null exception when getting activity display on Android API >= 30
Showing
1 changed file
with
1 additions
and
1 deletions
| @@ -182,7 +182,7 @@ class MobileScanner( | @@ -182,7 +182,7 @@ class MobileScanner( | ||
| 182 | @Suppress("deprecation") | 182 | @Suppress("deprecation") |
| 183 | private fun getResolution(cameraResolution: Size): Size { | 183 | private fun getResolution(cameraResolution: Size): Size { |
| 184 | val rotation = if (Build.VERSION.SDK_INT >= 30) { | 184 | val rotation = if (Build.VERSION.SDK_INT >= 30) { |
| 185 | - activity.applicationContext.display!!.rotation | 185 | + activity.display!!.rotation |
| 186 | } else { | 186 | } else { |
| 187 | val windowManager = activity.applicationContext.getSystemService(Context.WINDOW_SERVICE) as WindowManager | 187 | val windowManager = activity.applicationContext.getSystemService(Context.WINDOW_SERVICE) as WindowManager |
| 188 | 188 |
-
Please register or login to post a comment