Skip to content Skip to sidebar Skip to footer

Getting Data From Simpleadapter

I'm trying to get data from a SimpleAdapter, but I don't know the syntax for it. Example code: month_selector.xml

Solution 1:

Since this is a ListView you will have a spinner on each ListItem. So you will have to get spinner after getting the row View. I think below code should work. But I have not tried

intfirst= lv.getFirstVisiblePosition();
Viewitem= lv.getChildAt(first + rowid); //rowid is the row on which the spinner you want.    Spinnermonth= (Spinner)item.findViewbyId(R.id.spin_month); 

Edit: From post This looks to work

intfirstPosition= listView.getFirstVisiblePosition() - listView.getHeaderViewsCount(); // intwantedChild= rowid - firstPosition;
if (wantedChild < 0 || wantedChild >= listView.getChildCount()) {
  return;
}
Viewitem= lv.getChildAt(wantedChild);
Spinnermonth= (Spinner)item.findViewbyId(R.id.spin_month); 

Post a Comment for "Getting Data From Simpleadapter"