sree_iphonedev
sree_iphonedev

Reputation: 3534

Activity in Android

As I am new to android, trying to learn the basics in detail. Basically I am an iOS programmer. I would like to know how the "Activity in android" is compared with iOS. That means, what is Activity in android when comparing with iOS.

Thanks in advance.

Upvotes: 0

Views: 455

Answers (4)

Rajesh
Rajesh

Reputation: 15774

Although there is no 1:1 match for an Activity in iOS SDK, UIViewController is the closest match.

Beginning Android for iOS Developers can help you to cover some ground in writing your first Android app.

Upvotes: 1

Yusuf X
Yusuf X

Reputation: 14633

The Activity in Android is like the controller in iOS. It receives UI events, interacts with the data model, and updates the UI.

Upvotes: 1

ashish.n
ashish.n

Reputation: 1224

Check out the Documentation for Activity All of these are in there, and many of them contain more detail than what I've listed here.

1.This hook is called whenever the content view of the screen changes (due to a call to Window.setContentView or Window.addContentView).

2.Called when activity start-up is complete (after onStart() and onRestoreInstanceState(Bundle) have been called).

3.Called when activity resume is complete (after onResume() has been called).

4.This hook is called whenever the window focus changes.

5.Called as part of the activity lifecycle when an activity is about to go into the background as the result of user choice. For example, when the user presses the Home key, onUserLeaveHint() will be called, but when an incoming phone call causes the in-call Activity to be automatically brought to the foreground, onUserLeaveHint() will not be called on the activity being interrupted. In cases when it is invoked, this method is called right before the activity's onPause() callback. This callback and onUserInteraction() are intended to help activities manage status bar notifications intelligently; specifically, for helping activities determine the proper time to cancel a notfication.

6.Called whenever a key, touch, or trackball event is dispatched to the activity.

7.Called when the window has been attached to the window manager.

Upvotes: 2

Related Questions