1. The way of anonymous inner class
2, create a class implementation Onclicklistener, implement the OnClick method, set the control to pass a class object when clicked
3, let the current class implement Onclicklistener, set the control click event when passing a this. This approach is suitable for more buttons, generally in the company's use of the way
4, in the layout file for the control to add an OnClick property, in the layout of the activity to write an OnClick property value is the name of the method, to Publick, pass a view type of parameters, relatively suitable for doing simple test.
Layout:
1. Linear layout (vertical, horizontal): LinearLayout
Property:
Gravity: The alignment of the child control relative to the current control's alignment method.
2. Relative layout: relativelayout
3. Frame layout:
4. Table layout:
Four ways to write button click events and commonly used layouts in Android