I facing some issues in listview on navigation click. When i add add(myListView);
inside for loop, this loop add records on screen again and again for example 1st time add 1st record, 2nd time add 1st record again with 2nd record. Below is the code:
for(int i=0; i < totalfriends; i++){
imagearr = object.getJSONArray("pic_user_pro");
imgname = imagearr.getString(i);
if (imgname == "" || imgname == "null")
{
listThumb = getImage.getImageFromUrl("http://ugo.offroadstudios.com/wp-content/uploads/null.png"+connParams+"");
bmpResized = GPATools.ResizeTransparentBitmap(listThumb, 80, 80,
Bitmap.FILTER_LANCZOS, Bitmap.SCALE_TO_FIT);
}
else
{
listThumb = getImage.getImageFromUrl("http://ugo.offroadstudios.com/wp-content/uploads/"+imgname+""+connParams+"");
bmpResized = GPATools.ResizeTransparentBitmap(listThumb, 80, 80,
Bitmap.FILTER_LANCZOS, Bitmap.SCALE_TO_FIT);
}
listTitlearr = object.getJSONArray("nick_name");
listTitle = listTitlearr.getString(i);
friendidarr = object.getJSONArray("friends_user_id");
friendid = friendidarr.getString(i);
listDescarr = object.getJSONArray("interest");
listDesc = listDescarr.getString(i);
listDesc2arr = object.getJSONArray("location");
listDesc2 = listDesc2arr.getString(i);
v.addElement(new ListRander(bmpResized,listTitle ,listDesc,listDesc2, navBar));
// CustomListField With Event
final String nextGiftsId = friendid;
myListView = new CustomListField(v){
public boolean trackwheelClick(int status, int time)
{
UiApplication.getUiApplication().pushScreen(new ViewMoreHotlist(nextGiftsId));
return true;
}
};
add(myListView);
}// For Loop End
And also if i add ListView
outside the for loop and i add add(myListView);
outside for loop, this loop adds records on screen correctly but get ID of last record every time if i click on 1st record.
I want all record display on screen correct and when i click on any record it takes id of that record not other record.