Now the hottest Android development framework simply describes this simple description of the search for controls and the use of events
1. This method can not write Setconteview
@EActivity (R.layout.activity_main)
public class Mainactivity extends Activity {
2. Find controls basically three ways
/**
* Assign Value
* 1. Simple assignment via Viewbyid two ways
* 2. Assigning by @viewsbyid
* 3. Assignment via @afterviews
*/
3. Control display Content
/**
* Simple Assignment
* by @afterviews This method cannot be assigned in oncreat or it will be an error
*/
4. Binding Events
1) Click on the actual
2) long press event
/**
* Click event @click
*/
@Click (R.id.textview1)
public void Textviewclick () {
Toast.maketext (This, "OK", 1). Show ();
}
/**
* Long Press Event
*/
@LongClick (R.id.button1)
public void Button1 () {
Toast.maketext (This, "OK", 1). Show ();
}
Let's describe the ListView click event
New Twoactivity Page
Note that it is registered in XML
and jump questions
Twoactivity_ is not twoactivity.
Item Click event
Androidannotations simple Copy and click events (1)