android - creating customize listview through arrayAdapter -
whats wrong in code..
public class movieslistactivity extends listactivity { private arraylist<movie> movieslist; private arrayadapter<movie> moviesadapter; @suppresswarnings("unchecked") @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.movies_layout); movieslist = (arraylist<movie>) getintent().getserializableextra("movies"); moviesadapter = new moviesadapter(this, r.layout.movie_data_row, movieslist); setlistadapter(moviesadapter); if (movieslist!=null && !movieslist.isempty()) { longtoast(string.valueof(movieslist.size())); moviesadapter.clear(); moviesadapter.notifydatasetchanged(); (int = 0; < movieslist.size(); i++) { moviesadapter.add(movieslist.get(i)); } } moviesadapter.notifydatasetchanged(); } after moviesadapter.clear();, movieslist.size() become zero. , before clear code movieslist data. after removing moviesadapter.clear(), application forcefulness close... pls help..thanks
android android-listview android-arrayadapter
No comments:
Post a Comment