Close all running activities in an android application?

后端 未结 11 1776
死守一世寂寞
死守一世寂寞 2020-12-11 19:19

I create one application and never use finish() for each activity. If my user clicks on the logout button it goes to the previous page.

How can I close my previous

11条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-11 19:46

    Thanks for your replies. I solved my problem.

    Solution: I write a file with some data and when the user clicks logout, I remove data from that file and finish() current activity, and all in previous activity I write code in onResume() I read file and if it is blank or null finish() so in that it will close all your activity and your application get close. Thank you for the great help.

提交回复
热议问题