mirror of
https://github.com/immich-app/immich.git
synced 2025-06-03 13:44:16 -04:00
fix Android BackgroundServiceStartNotAllowedException (#687)
This commit is contained in:
parent
99a50f70dd
commit
789bc8563c
@ -14,7 +14,12 @@ class MainActivity: FlutterActivity() {
|
|||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
startService(Intent(getBaseContext(), AppClearedService::class.java));
|
try {
|
||||||
|
startService(Intent(getBaseContext(), AppClearedService::class.java));
|
||||||
|
} catch (e: Exception) {
|
||||||
|
// startService must not be called when app is in background (crashes app)
|
||||||
|
// there is nothing we can do
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user