Android View and ViewGroup

The Android View class and ViewGroup class are two very central classes in Android apps. An Android app contains one or more activities....


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.

View

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.

ViewGroup

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.

COMMENTS

Name

Android,9,Big Data,3,Cloud Apps,1,Database,1,Featured,12,Free Downloads,1,HowTo,1,IOT,7,Java,1,Linux,1,News,6,Products,1,SEO,1,TipsnTricks,5,Ubuntu,1,Unity3D,4,Windows Apps,1,
ltr
item
Tech Geek Bytes - A Blog For News, Tutorials, Free Source Code, Tips and Tricks: Android View and ViewGroup
Android View and ViewGroup
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNC94joLiIkHNLjJWCWa29T22PhhQXVqhL9sKg-1c5Edn5_Jl4QmxBIdOtHpy0kiONZ7Bqavs2wCkHOPbX2JnuowEhiYvurpKtWusq41DsH2x4DT24wfC5DQ1hB9Nkc-PYAIx4CKY1uxk/s1600/viewgroup+hierarchy.jpg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNC94joLiIkHNLjJWCWa29T22PhhQXVqhL9sKg-1c5Edn5_Jl4QmxBIdOtHpy0kiONZ7Bqavs2wCkHOPbX2JnuowEhiYvurpKtWusq41DsH2x4DT24wfC5DQ1hB9Nkc-PYAIx4CKY1uxk/s72-c/viewgroup+hierarchy.jpg
Tech Geek Bytes - A Blog For News, Tutorials, Free Source Code, Tips and Tricks
https://techgeekbytes.blogspot.com/2017/06/android-view-and-viewgroup.html
https://techgeekbytes.blogspot.com/
https://techgeekbytes.blogspot.com/
https://techgeekbytes.blogspot.com/2017/06/android-view-and-viewgroup.html
true
8751912191394201619
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy