Skip to content
Snippets Groups Projects
Commit c83c4d5f authored by Duncan McNamara's avatar Duncan McNamara Committed by Nicolas Pomepuy
Browse files

StartActivity: rm forward_result flag from intent

This flag is incompatible with startActivityForResult, and causes a
crash when opening the app from a third party app that uses it to open a
video.
parent 89c2deb5
No related branches found
No related tags found
1 merge request!1646StartActivity: rm forward_result flag from intent
Pipeline #301357 passed with stage
in 22 minutes and 22 seconds
......@@ -245,6 +245,8 @@ class StartActivity : FragmentActivity() {
finish()
return@launch
}
// Remove FLAG_ACTIVITY_FORWARD_RESULT that is incompatible with startActivityForResult
intent.flags = Intent.FLAG_ACTIVITY_FORWARD_RESULT.inv() and intent.flags
if (Permissions.canReadStorage(applicationContext) || getStoragePermission()) when {
intent.type?.startsWith("video") == true -> try {
startActivityForResult(intent.setClass(this@StartActivity, VideoPlayerActivity::class.java).apply { putExtra(VideoPlayerActivity.FROM_EXTERNAL, true) }, PROPAGATE_RESULT)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment