How to restart an application completely?

前端 未结 7 1474
长发绾君心
长发绾君心 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

提交回复
热议问题