Tutorials     About     RSS
Tech and Media Labs

Android View and ViewGroup

Jakob Jenkov
Last update: 2014-10-28

The Android View class and ViewGroup class are two very central classes in Android apps. An Android app contains one or more activities. An Android activity is a screen, similar to windows in a desktop application. Inside an activity you can have GUI components. The GUI components are instances of View or ViewGroup subclasses. It may sound a bit abstract at this point, but I will explain both in more detail below.


The View class is a superclass for all GUI components in Android. For instance, the TextView class which is used to display text labels in Android apps is a subclass of View. Android contains the following commonly used View subclasses:

  • TextView
  • EditText
  • ImageView
  • ProgressBar
  • Button
  • ImageButton
  • CheckBox
  • DatePicker

These are only some of the many, many subclasses of the View class.


The ViewGroup class is a subclass of the View class. ViewGroup instances work as containers for View instances to group View instances together. Android contains the following commonly used ViewGroup subclasses:

  • LinearLayout
  • RelativeLayout
  • ListView
  • GridView

These are not the only ViewGroup subclasses Android contains. There are others but which are less used.

The ViewGroup subclasses listed above group View instances together and takes care of their layout. For instance, the LinearLayout will render the components after each other either horizontally or vertically.

Jakob Jenkov

Featured Videos

Sponsored Ads

Maildroppa - Smart Email Marketing Solution
Close TOC

All Trails

Trail TOC

Page TOC