Actually, I would say that both iOS ViewControllers
and Android Activities
have their lifecycle methods. For example an equivalent of ViewController.viewDidLoad()
is Activity.onCreate()
?
Else I still need to know the equivalent of the other :
OnStart()
OnRestart()
OnResume()
OnStop()
OnDestroy()
OnPause()
We can say Activity is equivalent to ViewController, since it has its own lifecycle( onCreate in Android and viewDidLoad in iOS) but not fully.
The application life cycle constitutes the sequence of events that occurs between the launch and termination of application. It is very important to understand for all the iOS Developers, who wants smooth user experience.
The lifecycle for a service is similar to that for an activity, but different in a few important details: onCreate() and onStart() differences: Services can be started when a client calls the Context.
An Android activity goes through six major lifecycle stages or callbacks. These are: onCreate() , onStart() , onResume() , onPause() , onStop() , and onDestroy() . The system invokes each of these callbacks as an activity enters a new state.
This is a comparison between the lifecycle of Android vs iOS:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With