Thursday, 8 November 2012

Activity


  • An activity is the basis of android application

  • A single activity defines a single viewable screen,ie.the actions not the layout.

  • Activity have structured life cycle.


Let us see how  the basic main activity java file looks like



From the above HelloworldActivity.java file

setContentView(R.layout.main):- means the following

setContentView:-sets the specified view as the view of the   activity.

R.layout.main:-constant from R class referencing layout from the main.xml

1 comments:

Roney Joseph said...

What is the difference between activity and xml file??