How to restart an application completely?

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

    try this

       public void reload() {
         Intent intent = getIntent();
         overridePendingTransition(0, 0);
         intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
         finish();
    
         overridePendingTransition(0, 0);
         startActivity(intent);
        }
    

提交回复
热议问题