【问题标题】:Blackberry ObjectListField on click点击时的黑莓 ObjectListField
【发布时间】:2011-05-26 09:32:02
【问题描述】:

当用户点击列表项时,如何从黑莓对象列表字段中获取选定的行?

【问题讨论】:

  • 更具体。 (短问题不好)

标签: blackberry listfield


【解决方案1】:

getSelectedIndex()

您还必须设置 setChangeListener() 并实现相应的方法,如 fieldChanged() 和 keyDown()

您在询问之前是否阅读过文档?您有更具体的问题吗?

【讨论】:

    【解决方案2】:
    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;
    }
    

    【讨论】:

      猜你喜欢
      • 2011-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多