Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is this OK to understand that Activity is similar to ViewController in iOS?

Is this OK to understand that Activity is similar to ViewController in iOS?

I am confused to accept a concept of terms in Android as Activity, Service etc...

like image 400
Jeff Gu Kang Avatar asked Aug 20 '11 06:08

Jeff Gu Kang


People also ask

What is equivalent of activity in iOS?

We can say Activity is equivalent to ViewController, since it has its own lifecycle( onCreate in Android and viewDidLoad in iOS) but not fully.

What is the difference between View and ViewController?

Views are for display, model objects are for data, controllers are the glue in between them.

Is a ViewController a view?

A view controller manages a single root view, which may itself contain any number of subviews. User interactions with that view hierarchy are handled by your view controller, which coordinates with other objects of your app as needed. Every app has at least one view controller whose content fills the main window.

How many view controllers are possible in iOS app?

There are two types of view controllers: Content view controllers manage a discrete piece of your app's content and are the main type of view controller that you create.


1 Answers

Yes, I would say that Activity and ViewController are rather similar. There is just one BIG difference. In iOS you have a delegate to control your application's state, like a new ViewController has started or the application is finished. In Android you do this separately for each activity via onCreate(), onPause(), etc.

like image 188
superM Avatar answered Sep 19 '22 19:09

superM