Android studio finish(); doesnt kill the activity and it is running in background

时间:2016-04-25 09:44:00

标签: java android android-activity activity-finish

I have multiple activities on android application.

When i jump from one activity to next activity i am finish(); the previous activity but it is still running in background and creates some issue to my application.

How can i stop the activity completely to stop running???

1 个答案:

答案 0 :(得分:1)

打开这样的每个活动。它将完成当前的并且应该有助于阻止它们堆叠。

    Intent intent = new Intent(this, YourMainActivity.class);
    startActivity(intent);
    finish();