Exit/Finish an app/activity - android

前端 未结 12 743
醉梦人生
醉梦人生 2021-02-05 05:04

I\'ve got 4 activities say Act1, Act2, Act3 and Act4. A button in Act1 opens Act2, a button in Act2 opens Act3, a button in A

12条回答
  •  野性不改
    2021-02-05 06:04

    Place this code in your app:

    moveTaskToBack(true);
    android.os.Process.killProcess(Process.myPid());
    System.exit(1);
    

提交回复
热议问题