Android – how to refresh the contents of a single line in a listview using onItemClick

I have a belt Check@R_ 959_ 2419 @ listview. What I want to implement is onItemClick (in my activity). If I click this line, I will check / select my Check@R_ 959_ 2419 @, as follows:

@Override
public void onItemClick(AdapterView<?> parent, View view,
        int position, long id) {
    MyItem row = ListofRows.get(position);
    row.setSelected(true);
    myAdapter.notifyDataSetChanged();
}

When I click on the row, the listview is refreshed due to the method notifydatasetchanged()

The problem is: this method refreshes the entire listview, so even if the user is at the bottom of the list, the scrollbar will start (the user is driven to the title of the list)

What I need is to refresh the clicked line so that the user is not driven to the beginning of the list

Is there any solution to this problem?

resolvent:

View v = getlistview.getchildat (index) using the selected index;

Now update the view with the new value

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>