A place to pay attention to (unexpected title)

Source: Internet
Author: User

The two days have been troubled by a strange bug.


The symptom is this: there is a edittext below the ListView, and the ListView will re-read the data when entering characters in the EditText, making the app run very slowly


In the code, GetView is only called when it is loaded, and should not be invoked at this time.


Looked for a long time code, finally found the problem!! (De other people's bug is really sad)


This is a vertical linearlayout, above a ListView, below or a linearlayout, the height is controlled by weight

And the height of the linearlayout below is wrapcontent.

When the edittext changes, the height changes, affecting the change of the ListView (although it actually does not change, but still leads to the GetView call)

If you find that the ListView is constantly setadapter, you may want to check if the layout is a problem


A place to pay attention to (unexpected title)

Related Article

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.