1, the basic concept of view
View is the parent class for all control classes. (Text, button, multiple selection, layout, ... ··· )
2. Get the object representing view in activity
Use Findviewbyid (R.ID.PPP);PPP to represent the ID of the control
For example TextView textview= (TextView) Findviewbyid (R.id.textview);
The method returns a view type and must use a control that is transformed downward into a response.
3. Set the properties of the view
Use the object of the previous TextView;
You can modify the Text property of the control, such as: Textview.settext ("Hello World");
4. Set Listener for View
1) Gets the object that represents the control (as mentioned in the 2nd)
2) Define a class that implements a listener interface such as: Define a Onclicklistener interface Buttonlistener
3) Generate listener objects such as: Generate a Onclicklistener object Buttonlistener, the replication of its OnClick method;
4) binds the listener object to the control such as: Button.setonclicklistener (Buttonlistener); After binding, the listener's OnClick method is called whenever the button is pressed.
"===================end========================="