How to close Android application?

后端 未结 22 1551
小蘑菇
小蘑菇 2020-11-22 07:17

I want to close my application, so that it no longer runs in the background.

How to do that? Is this good practice on Android platform?

If I rely on the \"ba

22条回答
  •  天涯浪人
    2020-11-22 08:02

    Put a finish(); statement as below:

    myIntent.putExtra("key1", editText2.getText().toString());
    
    finish();
    
    LoginActivity.this.startActivity(myIntent);
    

    In every activity.

提交回复
热议问题