Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android onResume and onCreate

I have a question regarding the logic of the life cycle of activities:

enter image description here

When I learned Android, setting up an Activity was always done in the onCreate() function. Now when I resume my Activity, there might be stuff to be done in the onResume() that has already been done in onCreate(). But then, why would we not just put all the stuff into onResume()?

like image 723
PKlumpp Avatar asked Dec 06 '25 15:12

PKlumpp


1 Answers

why would we not just put all the stuff into onResume()?

Well onCreate() is called when your Activity is created and you need to initialize some very important things of your application like your main layout!.

like image 154
Jorgesys Avatar answered Dec 08 '25 08:12

Jorgesys



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!