Android: App with services keeps showing up in Overview Screen after calling finish() and System.exit(0)

一个人想着一个人 提交于 2020-01-03 05:07:42

问题


The App has several running services in the background. They run before and I want them to continue running even after the App closes.

After I call from Activity:

finish();
System.exit(0);

The App removes from foreground, but in the Overview Screen (long menu btn press) the App still appears. And it's always with same behaviour:

  • First click on the App to open: The Overview Screen closes and nothing happens.
  • Second click on the App to open: The Overview Screen closes and the App come back to the last point it works OK before calling finish() etc.

Why is it happens and how can I properly close the App (keeping the background services still running)?

EDIT: It seems something more general: Android: Behaviour of App in Overview Screen after calling finish()

来源:https://stackoverflow.com/questions/32606559/android-app-with-services-keeps-showing-up-in-overview-screen-after-calling-fin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!