Android face test-controls and optimization

Source: Internet
Author: User

1. How to optimize the efficiency of the ListView

From the point of view of data loading

1) Paging
2) Asynchronous loading
3) Time-consuming operation to user progress tips

From the display angle of the mass data

1) in separate line bunch load picture

To achieve this, we may need to use the Asynctask designed specifically for this case. In fact, you will notice that the Asynctask is limited to 10 or less. This number is hard coded in the Android SDK, so we can't change it. This is a matter of limitations for us because there are often more than 10 images being downloaded at the same time. One workaround is to manually create a thread for each picture. In addition, we should use handler to invoke the downloaded image to the UI thread. The reason we do this is that we can only modify the UI in the UI thread.

2) Reuse list row Findviewbyid Viewholder

3) The view Convertview tag in the cache line

Reference: http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2013/0303/951.html

Android face test-controls and optimization

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.