【问题标题】:BlackBerry ListField--How to open the selected list itemBlackBerry ListField--如何打开选定的列表项
【发布时间】:2012-04-23 16:42:54
【问题描述】:

如何在黑莓中打开选中的列表字段?

    listNames = new Vector();
    field = new ListField();

    ListCallBack _callback = new ListCallBack();
    field.setCallback(_callback);
    add(field);
    intialseList();
}

private void intialseList() {
    String name = "Sriaknth";
    String name2 = "pradeep";

    listNames.addElement(name);
    listNames.addElement(name2);
    reloadList();

}

private void reloadList() {
    field.setSize(listNames.size());
}

【问题讨论】:

    标签: blackberry java-me


    【解决方案1】:

    覆盖屏幕中的navigationclick方法,点击时调用listNames.getSelectedIndex();

    【讨论】:

    • 应该是field.getSelectedIndex() 而不是listNames.getSelectedIndex();
    【解决方案2】:

    您可以在已添加 ListField 的类中覆盖 navigationClick(int status, int time) 方法...

    protected boolean navigationClick(int status, int time) {
        if(field.getSelectedIndex());
                return true;
    
    }   
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多