srikanth_yarram
srikanth_yarram

Reputation: 957

BlackBerry ListField--How to open the selected list item

how to open the selected list field in blackberry?

    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());
}

Upvotes: 2

Views: 731

Answers (2)

rfsk2010
rfsk2010

Reputation: 8611

override navigationclick method in the screen , and on click, call listNames.getSelectedIndex();

Upvotes: 1

BBdev
BBdev

Reputation: 4942

you can override navigationClick(int status, int time) method in the class where you have added the ListField...

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

}   

Upvotes: 1

Related Questions