Andoroid Lecture
Andoroid Lecture
MCA SEM 1
Dr. Manoj Devare
Faculty Incharge
What is View and ViewGroup in Android
Programming
• This class represents the basic building block for user interface
components.
• A View occupies a rectangular area on the screen and is responsible
for drawing and event handling.
• View is the base class for widgets, which are used to create interactive
UI components (buttons, text fields, etc.).
• The ViewGroup subclass is the base class for layouts, which are
invisible containers that hold other Views (or other ViewGroups) and
define their layout properties.
Button Event
Button b1=(Button)findViewById(R.id.button);
b1.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
TextView t1=(TextView)findViewById(R.id.text1);