Issue
I have a music player with a noncancellable notification. In my onDestroy, i have a clearNotification method. However when I clear the app by holding the home button and clear recent apps, the music stops but the onDestroy method is not ran because the notification doesn't clear.
So my question is, Is there any method that is ran when user clears "Recent Apps" in Android.
Solution
It seems the best way would be to create a Service and look for the onTaskRemoved method to be called.
Look here for extensive conversation: https://android.stackexchange.com/questions/19987/what-actually-happens-when-you-swipe-an-app-out-of-the-recent-apps-list
Here's the Service API I suggest using: http://developer.android.com/reference/android/app/Service.html#onTaskRemoved%28android.content.Intent%29
Answered By - Sam Dozor
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.