1. Download our Official Android App: Forums for Android!

Apps Reference for the 'Layout'

Discussion in 'Android Development' started by narke, Sep 27, 2012.

  1. narke

    narke Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    9
    Joined:
    Mar 22, 2010

    Mar 22, 2010
    9
    0
    5
    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 Member
    Rank:
    None
    Points:
    36
    Posts:
    42
    Joined:
    Aug 23, 2012

    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 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    9
    Joined:
    Mar 22, 2010

    Mar 22, 2010
    9
    0
    5
    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 Member
    Rank:
    None
    Points:
    36
    Posts:
    42
    Joined:
    Aug 23, 2012

    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 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    9
    Joined:
    Mar 22, 2010

    Mar 22, 2010
    9
    0
    5
    oh... Thanks!
     

Share This Page

Loading...