Philosophical analysis of multiplexing problems in Android

Source: Internet
Author: User

The reuse of lists in Android improves the efficiency of the app, but the attendant problem of reuse is always a headache for programmers, a

The bug was not found the night before. I will give my own experience in this area to contribute for your reference:


Question 1: What is multiplexing

Reuse refers to the reuse view, and the data of the bound view is changed.


Issue 2: Reusing a scene that appears

In adapter, if the data of the view is bound if there is an if judgment, many people forget to add else, which is the root of most reuse problems.

Actual scenario:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/86/E2/wKiom1fOIjnzXZ7WAADoxtBhZN8794.png "title=" Qq20160906095143.png "alt=" wkiom1foijnzxz7waadoxtbhzn8794.png "/> such as each item may have or no picture picarrlist, before I only add the If judgment, If you have a picture, display it. But then the next slide to find that no picture of the item unexpectedly also shows the other item's picture, so traced to find is the problem here.



Philosophical analysis of multiplexing problems in Android

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.