Search code examples
androidlistviewbaseadapter

how to refresh listView from its adapter


What would be the best way to refresh the ListView from its BaseAdapter? I am having a ListView that has an adapter. Here one of the views has a button that when the user clicks I would like to refresh a certain view (at position).

I have tried calling the following code in public View getView(int position, final View convertView, final ViewGroup parent), but this doesn't work.

View attendingUsers = parent.getChildAt(11);
attendingUsers.invalidate();

Is there a way to redraw the view?


Solution

  • Calling notifyDataSetChanged(); solved my problem