org.androidannotations.annotations
Annotation Type ItemSelect
@Retention(value=CLASS)
@Target(value=METHOD)
public @interface ItemSelect
This annotation is intended to be used on methods to receive events defined
by android.widget.AdapterView.OnItemSelectedListener#onItemSelected(android.
widget. AdapterView>, android.view.View, int, long)
when a list item has
been selected by the user.
The annotation value should be one or several of R.id.* fields. If not set,
the method name will be used as the R.id.* field name.
The method MAY have one or two parameters :
- A
boolean
to know if the item selected or not
- An
int
parameter to know the position of the long clicked
item. Or, a parameter of the type of the Adapter linked to the listview.
Example :
@ItemSelect(R.id.myList)
public void itemSelectedOnMyList() {
// ...
}
@ItemSelect(R.id.myList)
public void myListItemPositionSelected(int position) {
// ...
}
@ItemSelect
public void myListItemSelect(MyItem clickedItem) {
// ...
}
@ItemSelect(R.id.myList)
public void myListItemPositionSelected(boolean selected, int position) {
// ...
}
- See Also:
ItemClick
,
ItemLongClick
value
public abstract int[] value
- Default:
- -1
resName
public abstract String[] resName
- Default:
- ""
Copyright © 2010-2014. All Rights Reserved.