Reference for the 'Layout'


Last Updated:

  1. narke

    narke Member This Topic's Starter

    Joined:
    Mar 22, 2010
    Messages:
    9
    Likes Received:
    0
    Hi,

    I am first to this. Since I see a layout id can be passed to setContentView() method of Activity object, so I guess a layout is subclass of View. But the strange thing is that I did find the class reference for the Layout in the API reference section. Could someone please point me to the right location? And, also the class R.layout looks hard to understand to me.

    Thanks in advance.
    -narke
     

    Advertisement
  2. Kostas G

    Kostas G Active Member

    Joined:
    Aug 23, 2012
    Messages:
    42
    Likes Received:
    7
    A Layout is a subclass of ViewGroup, which is a subclass of a View. Therefore a Layout is actually a View.

    R.layout defines some standard layouts that you can use in your application. It is used with Lists and Spinners.
     
  3. narke

    narke Member This Topic's Starter

    Joined:
    Mar 22, 2010
    Messages:
    9
    Likes Received:
    0
    Thanks for the confirmation. Can you also please how do I find the Layout class reference in the API reference documentation on the Android development web?

    Many thanks!
    -narke
     
  4. Kostas G

    Kostas G Active Member

    Joined:
    Aug 23, 2012
    Messages:
    42
    Likes Received:
    7
    There isn't a Layout class. As I wrote in the previous post, there is the ViewGroup class, which is extended by Layout implementations. You can read about the common layouts here.
     
  5. narke

    narke Member This Topic's Starter

    Joined:
    Mar 22, 2010
    Messages:
    9
    Likes Received:
    0
    oh... Thanks!
     

Share This Page

Loading...