I am little confused between the life cycle of two activities.
Suppose I have Activity A and Activity B.
B is called From A i.e A ----> B.>
The onDestroy method is called after back press. Then activity will be popped from the Activity back stack.
From docs:
If an activity is paused or stopped, the system can drop the activity from memory by either asking it to finish, or simply killing its process. When it is displayed again to the user, it must be completely restarted and restored to its previous state.
onDestroy() from docs:
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 theisFinishing()method.
