|
@@ -14,7 +14,12 @@ class MainActivity: FlutterActivity() {
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
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
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|