-2

Since the Android Developer Task And Backstack topics declares

When all activities are removed from the stack, the task no longer exists.

then why the task is stay visible in Overview Screen, after removing all of it activities. It may be suggested that Overview screen contains some kind of reference to recent tasks as well, but not only currently running. I can not find a clear explonation on Android Developer site, so any one can get a clue?

NOTE: Also running a simple notification service from activity (which, as i suggest, will be running in current task) will indicates the service is still here after removing all activities, but immediately disappear after swiping task away.

  • What do you mean by `removing all of it activities`? Just navigating back from the activities till you reach the home screen or removing the app task from overview screen? – Rami Jan 15 '16 at 10:46
  • I mean navigating back till home screen – N. Chebotarev Jan 15 '16 at 15:05

2 Answers2

0

Notification is removed because the activities are destroyed with service when it is swiped from recent tasks.Try to use startService instead of bindService. Post some code.

Gugan Sakthivel
  • 61
  • 1
  • 10
  • Thanks, but it is not about it. Service was just an example. All activities wore already destroed (by navigating back from each one), even so task is still displaying in overview. – N. Chebotarev Jan 11 '16 at 16:54
  • The question is more theoretical, but important for understanding particular things. I have no specific code problem – N. Chebotarev Jan 11 '16 at 17:00
  • The activity always remains in overview screen but if all the activities are destroyed it will open MainActivity. Actually you're question is not clear. – Gugan Sakthivel Jan 12 '16 at 12:33
0

Well, navigating back till the home screen doesn't mean that all your activities have been destroyed and removed from the stack.

When all activities are removed from the stack, the task no longer exists.

In fact, your Activity task persists in the background, because the user may return to it later (for example, via the Recents screen). This is why your app services (that runs on the same task), won't be stopped.

Rami
  • 7,879
  • 12
  • 36
  • 66