ListView Single Row Refresh

Source: Internet
Author: User

Before you want to change a row of the ListView content or display the Delete button, and so on, to adapter.notifydatasetchanged (); refresh, less data can also, when the data will obviously consume performance, a separate refresh of a line will not, this also thanks to Kun (Ox people , college roommate) teaches methods that I now share to everyone

In the place where you're going to refresh adapter.

Position is clicking the row position of the ListView

Of course, you need to change the data content before executing the following 2 lines of code.

For example:

if (orderlist[pos].getstatus () = = 0) {

orderList[pos].setStatus(1);

} else {

orderList[pos].setStatus(0);

}

This method refreshes a row item individually

View view = Listview.getchildat (Position-listview.getfirstvisibleposition ());
Listview.getadapter (). GetView (position, view, ListView);

ListView Single Row Refresh

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.