Reputation: 1735
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?
Upvotes: 3
Views: 3530
Reputation: 1160
This will work only for RecyclerView and not for ListView. Use notifyItemChanged (int position, Object payload) it is much more efficient, for more information: notifyItemChanged reference
Upvotes: -1