The following figure (from the official doc) describes the well-known lifecycle of an Android activity:
In addition to already posted answers, there is a subtle change introduced in Android P, which is:
void onSaveInstanceState(Bundle outState)
If called, this method will occur AFTER
onStop()
for applications targeting platforms starting with P. For applications targeting earlier platform versions this method will occur beforeonStop()
and there are no guarantees about whether it will occur before or afteronPause()
.
Source: docs
As to why this change is introduced, here's the answer:
... so an application may safely perform fragment transactions in
onStop()
and will be able to save persistent state later.
Source: docs