onDestroy() explanation (#20344)

Gave an instance of when the onDestroy call would be used in practice
This commit is contained in:
Jared Ezzet Hasson
2018-10-29 08:53:44 -06:00
committed by Tom
parent fe7d5c53ea
commit 88041d1955

View File

@ -43,7 +43,7 @@ An _activity_ is a component that has a user interface and represents a single s
* onDestroy(): * onDestroy():
> The final call you receive before your activity is destroyed. This can happen either because the activity is finishing (someone called finish() on it, or because the system is temporarily destroying this instance of the activity to save space. You can distinguish between> these two scenarios with the isFinishing() method. > The final call you receive before your activity is destroyed. This can happen either because the activity is finishing (someone called finish() on it, or because the system is temporarily destroying this instance of the activity to save space. You can distinguish between> these two scenarios with the isFinishing() method. This call is often used when the user hits the back button, or closes the instance of the app.
#### Sample code to understand Activity Lifecycle #### Sample code to understand Activity Lifecycle
``` java ``` java