目前,当我单击任何列表项时,它会获取第一次单击的列表项索引的索引,这意味着如果我单击视频,即使我单击显示视频数据的图像,它也会保存视频单击索引。我想当我点击任何项目时,它只显示选定的索引数据,并且有可能我动态地获得选定的项目列表标题??
Vector v = new Vector();
for (int i = 0; i < 3; i++) {
final String listTitle = _folderList[i]._fileName;
v.addElement(new ListRander(closedIcon, listTitle, playIcon));
// CustomListField With Event
myListView = new CustomListField(v) {
public boolean trackwheelClick(int status, int time) {
// which row is selected?
int index = getSelectedIndex();
if (index == 0) {
String ImageIndex = "Images";
UiApplication.getUiApplication().pushScreen(new ImagesList(ImageIndex, _ftp));
}
if (index == 1) {
String MusicIndex = "Music";
UiApplication.getUiApplication().pushScreen(new MusicList(MusicIndex, _ftp));
}
if (index == 2) {
String VideoIndex = "Video";
UiApplication.getUiApplication().pushScreen(new VideosList(VideoIndex, _ftp));
}
return true;
}
};
}// For Loop End
add(myListView);