how to close android app completely

前端 未结 7 1774
一个人的身影
一个人的身影 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

    If you want to close application completely you should use finishAffinity(); instead of finish() . It will clear all stack of activities previously opened by an application.

提交回复
热议问题