Blackberry ObjectListField on click
How to get selected row from blackberry objectlistfield, when user clicks on list it开发者_StackOverflow中文版em?
getSelectedIndex()
You will also have to set the setChangeListener() and implement the corresponding methods like fieldChanged() and keyDown()
have you read the documentation before asking ? Do you have a more specific question ?
public boolean navigationClick(int status, int time) {
Field focus = list.getLeafFieldWithFocus();
Dialog.alert("Focus String :: " + focus.getIndex());
if (focus instanceof ListField) {
ListField listField = (ListField)focus;
Dialog.alert("Selected Index"+listField.getSelectedIndex());
Dialog.alert("Selected List Value"+listField.getCallback().get(listField,
listField.getSelectedIndex()).toString());
}
return true;
}
精彩评论