2011-09-19 43 views
1

如何在BlackBerry中獲取ObjectListField的索引,以便在單擊對象列表中的一個項目時,我們可以檢索項目的位置?BlackBerry對象列表開發

+0

使用getSelectedIndex()方法 – koti

回答

3

使用下面的代碼用於獲取指數:

int index = yourObjectListField.getSelectedIndex(); 

而下面的代碼來獲取文本:

String selectedText += yourObjectListField.get(yourObjectListField, yourObjectListField.getSelectedIndex());