0
I have a listview
populated by an object, but I wanted to know if there is a way to change the object, I managed to change the view corresponding to that Object, and not to listView
entire.
0
I have a listview
populated by an object, but I wanted to know if there is a way to change the object, I managed to change the view corresponding to that Object, and not to listView
entire.
1
Create a method to change the list item, add conditions to capture the specific item you want to change. You need to go item by item in the list, use the for
for such:
for (Object ob : listObj) {
if('vouAlterar'.equals(ob.getNome())) {
ob.setNome = 'Alterei';
}
}
Browser other questions tagged android listview
You are not signed in. Login or sign up in order to post.
Use the
notifyDataSetChanged
in hisAdapter
will not change all objects, only the visible ones. An alternative is to set a tagView.setTag(...);
to identify eachView
returned byAdapter
in the methodgetView(...)
and in theListView
walk the children (ViewGroup.childAt(index)
) check by tag and modify theView
manually.– Wakim