Add FLAG_ACTIVITY_NEW_TASK to fix updates for some older devices (#211)

Without this the installation intent is crashing with an error on my
Xiaomi Mi Box S (Android 8.1)
This commit is contained in:
Jakub Syty 2025-11-13 23:27:20 +01:00 committed by GitHub
parent 19b712d54b
commit f61e819a98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -236,7 +236,7 @@ class UpdateChecker
val targetFile = fallbackDownload(it, callback)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val intent = Intent(Intent.ACTION_INSTALL_PACKAGE)
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_ACTIVITY_NEW_TASK)
intent.data =
FileProvider.getUriForFile(
context,