Activity.finish ()
Call the When the your activity is do and should be closed.
Call this method when your activity is completed, or when the activity needs to be closed.
When you call this method, the system simply moves the top activity out of the stack and does not call the Ondestory () method in a timely manner, and its resources are not released in a timely manner. Because the stack is removed, you won't find the activity when you click on the "Back" button on your phone.
Activity.ondestory ()
The system is temporarily destroying this instance of the activity to save space.
The system destroys the space occupied by the instance of the activity in memory.
During the activity life cycle, the Ondestory () method is the last step of his life, and the resource space is recycled. When you re-enter this activity, you must recreate and execute the OnCreate () method.
System.exit (0)
This thing is out of the entire application and is for the entire application. The entire process is directly KO dropped.
------------------------------------------
The finish function simply exits the current activity, but does not release his resources. The Android system itself decides when to release the application from memory. When the system does not have available memory, it will release some of the apps by priority.
The difference between finish () OnDestroy () and System.exit () in Android development-activity