how to close android app completely

前端 未结 7 1736
一个人的身影
一个人的身影 2020-12-03 01:59

I created an android application with a logout option in onCreateOptionsMenu. The Logout works perfectly but when I press the back button again it takes me to t

相关标签:
7条回答
  • 2020-12-03 02:29

    Even if it looks ok killing process will cause you headache in future. You can ensure this by following use case:

    1. call several activities to populate activities stack
    2. call android.os.Process.killProcess(pid);
    3. open your application

    OBSERVED: Your application opens not from main activity in inconsistent way. This is because Android consider killing of process like crash.

    You can find more detailed information here: Is quitting an application frowned upon?

    0 讨论(0)
提交回复
热议问题