I think the preferred way is to update the adapter itself and not to replace it. Maybe you can write a method that merges the new and old data using the adapters insert()
and remove()
methods. I think that should keep your position.
Added Information:
I use the following as basic structure. Maybe it helps.
public class PlaylistAdapter extends ArrayAdapter<Playlist> {
private ArrayList<Playlist> items;
public PlaylistAdapter(Context context, int textViewResourceId, ArrayList<Playlist> items) {
super(context, textViewResourceId, items);
this.items = items;
}
}
hacksteak25
2010-09-07 16:52:38