android - List view not showing up items in few devices and emulators -
i have listview populated custom adapter. xml of list is:
<listview android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="fill_parent"> </listview>
and utilize next code view list
public view getview(int position, view convertview, viewgroup parent) { // todo auto-generated method stub layoutinflater inflater; entryitem temp; textview tventry,tvdate; if(convertview == null) { inflater=layoutinflater.from(parent.getcontext()); convertview = inflater.inflate(r.layout.entrylayout , parent, false); } tventry=(textview)convertview.findviewbyid(r.id.tventry); tvdate=(textview)convertview.findviewbyid(r.id.tvdate); temp=(entryitem)getitem(position); tventry.settext(temp.getentry()); tvdate.settext(temp.getentrydate()); homecoming convertview; }
this how bind adapter:
//i values activity main activity through bundle //i load them adapter myadapter.addentry(bundle.getstring("name"), bundle.getstring("date"));
i oncreate:
entrylist=(listview)findviewbyid(android.r.id.list); entrylist.setadapter(myadapter);
entry item class defines construction of items in list. bind adapter using arraylist of class. problem work fine in emulator , few devices, fails in few others. used log.d entry added adapter, values displayed. there no exceptions thrown either. thought else might error ?
android android-listview
No comments:
Post a Comment