Android Resume Technology Point-master the optimization of the ListView and asynchronous task load network data.

Source: Internet
Author: User

for the interview, it may be the problem of the ListView, always high-frequency appearance, after all, the development of his appearance is also high-frequency. I'll say first. Basic Optimization

ListView optimization1. Reuse to reduce memory consumption---->convertview to determine whether it is empty, not empty, directly re-use. Give him a layout when it's empty.

2. Reduce the number of lookup IDs-----> Define a Viewholder Storage control and then bind it to Convertview


For the above two, if you can use it in your project and extract the Viewholder into a separate class for reuse, the interviewer will have a better view of you.


Go ahead. If the data volume of the ListView is larger than the operation is still a bit of a problem than the chip processing this point in the next section, you can also directly joint image compression cache to display together to say


3. With large amounts of data, we can use page loading, and batch loading

At this point you need to elaborate on the steps of batch loading or you might want to get a high salary a little harder.

The implementation of the ListView batch loading:

The best answer is to talk with the project you wrote on your resume.

① implements the Onscrolllistener interface override Onscrollstatechanged and Onscroll methods, swipe with onscroll to check for data, If there is a Addfooterview added to adapter remember to brush it if it is not the custom footer removed, use onscrollstatechanged You can detect if you are rolling to the last row and stop scrolling to load data


Asynchronous Tasks Load network data1. Get the picture display from the memory cache first2. Get no more from SD,3. Download the picture from the network and save it in SD, add the memory and display it.
above three steps if you can tell the details, you can explain the source 1.1 points clearly tomorrow continue to write the next week to interview ....

Android Resume Technology Point-master the optimization of the ListView and asynchronous task load network data.

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.