Is there a way to know when an application has bee...
# android
j
Is there a way to know when an application has been closed (swiped away in android recents screen)? I have a foreground service which should survive process death but would stop when the application has deliberately been closed by a user.
i
s
+1 to onTaskRemoved. FYI, it doesn't work on Xiaomi devices with MIUI skin.
i
That's because they force stop your whole app when you swipe away the task, killing everything as per https://dontkillmyapp.com/xiaomi
s
@Ian Lake thanks, I know it. I have struggled with similar things in android for 7 years.
123 Views