Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android lifecycle event CREATED

If you follow the link https://developer.android.com/reference/androidx/lifecycle/Lifecycle.State.html#CREATED you'd see that CREATED event is raised in two conditions

1) after onCreate (understandable ) 2) right before onStop(wait what ?)

why would the lifecycle raise the CREATED event just before onStop ?

like image 652
Muhammad Ahmed AbuTalib Avatar asked Aug 11 '26 15:08

Muhammad Ahmed AbuTalib


1 Answers

First of all, CREATED is not an event but an activity state. The given doc means after onCreate() called, activity is in CREATED (then became RESUMED after onResume() called). When the activity onStop() called, activity became CREATED again (CREATED but not RESUMED in this case).

like image 170
StoneLam Avatar answered Aug 13 '26 09:08

StoneLam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!