@Retention(value=CLASS) @Target(value=METHOD) public @interface ItemSelect
This annotation is intended to be used on methods to receive events defined
by
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 :
boolean to know if the item selected or notint 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) {
// ...
}
ItemClick,
ItemLongClickpublic abstract int[] value
public abstract String[] resName
Copyright © 2010-2015. All Rights Reserved.