【发布时间】:2011-09-19 09:26:47
【问题描述】:
如何在BlackBerry中获取ObjectListField的索引,以便在单击对象列表中的一项时,我们可以检索一项的位置?
【问题讨论】:
-
使用 getSelectedIndex() 方法
标签: blackberry
如何在BlackBerry中获取ObjectListField的索引,以便在单击对象列表中的一项时,我们可以检索一项的位置?
【问题讨论】:
标签: blackberry
使用以下代码获取索引:
int index = yourObjectListField.getSelectedIndex();
以及下面的代码来获取文本:
String selectedText += yourObjectListField.get(yourObjectListField, yourObjectListField.getSelectedIndex());
【讨论】: