当用户点击列表项时,如何从blackberry objectlistfield中获取所选行?
答案 0 :(得分:2)
您还必须设置setChangeListener()并实现相应的方法,如fieldChanged()和keyDown()
您在询问前阅读了文档吗?你有更具体的问题吗?
答案 1 :(得分:1)
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;
}