1. activitytwo. Finish ();
Call this method when your activity is completed or when the activity needs to be closed.
When you call this method, the system only removes the top activity from the stack and does not call the ondestory () method in time. The resources occupied by the ondestory () method are not released in time. Because the stack is removed, you will not find this activity when you click the "back" button on your phone;
2. activitytwo. ondestroy ();
The system destroys the memory occupied by the activity instance.
In the life cycle of an activity, the ondestory () method is the last step of its life, and the resource space is recycled. When re-entering this activity, you must re-create and execute the oncreate () method.
3. system. Exit (CODE );
This is to exit the entire application and target the entire application. If the code is 0, the system Exits normally;