How to restart an application completely?

前端 未结 7 1476
长发绾君心
长发绾君心 2021-01-04 17:35

I have an application which starts a Remote Service in its first launched activity. Then, in another activity, the user can set the configuration of the application. Please

相关标签:
7条回答
  • 2021-01-04 18:37

    in your restart activity add this

    restart.this.finish();
    getActivity(otheractivity.class).finish();
    Intent in = new Intent(this,main.class);
    startActivity(in);
    

    for each of your activity add getactivity(yourclassname) then finish activity. if you add all your activity like this your application close & restart

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