diff --git a/app/src/main/java/com/github/cvzi/screenshottile/activities/TakeScreenshotActivity.kt b/app/src/main/java/com/github/cvzi/screenshottile/activities/TakeScreenshotActivity.kt index 38c6dbe7..8616cc82 100644 --- a/app/src/main/java/com/github/cvzi/screenshottile/activities/TakeScreenshotActivity.kt +++ b/app/src/main/java/com/github/cvzi/screenshottile/activities/TakeScreenshotActivity.kt @@ -345,7 +345,12 @@ class TakeScreenshotActivity : Activity(), App.createMediaProjection() } catch (e: SecurityException) { Log.e(TAG, "prepareForScreenSharing(): SecurityException 3") - null + Handler(Looper.getMainLooper()).postDelayed({ + // Something went wrong, restart everything + finish() + App.getInstance().screenshot(this) + }, 500) + return } if (mediaProjection == null) { screenShotFailedToast("Failed to create MediaProjection", Toast.LENGTH_SHORT)