android - How to Logout from the application

后端 未结 4 1418
情话喂你
情话喂你 2020-12-17 07:12

My Application have 5 activities(A1,A2,A3,A4,A5). Each activity have one text view and one button(B1,B2,B3,B4,B5). If you click on that button then goes to next activity. su

4条回答
  •  庸人自扰
    2020-12-17 07:38

    You have to close your activities (all of them) every time with finish() when you open the next one. Now, when user hits logout, there is only one of your application activity active and when this is closed, your application "exits".

    Note: It doesen't matter whether you call finish() before or after startActivity().

提交回复
热议问题