What is the difference between a View
and a ViewGroup
in Android programming?
View
objects are the basic building blocks of User Interface(UI) elements in Android.View
is a simple rectangle box which responds to the user's actions.EditText
, Button
, CheckBox
etc..View
refers to the android.view.View
class, which is the base class of all UI classes. ViewGroup
is the invisible container. It holds View
and ViewGroup
LinearLayout
is the ViewGroup
that contains Button(View), and other Layouts also.ViewGroup
is the base class for Layouts.