Android error: The content of the adapter has changed... and Channel is unrecoverably broken and will be disposed analysis and solution, hostchanneladapter

Source: Internet
Author: User

Android error: The content of the adapter has changed... and Channel is unrecoverably broken and will be disposed analysis and solution, hostchanneladapter

Adapter error in Android:

The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread.

Analysis:

This error is usually caused by a static list that may be passed in by listview and other controls when adapter is used to adapt to data. In the adapter, The = number is directly used to assign values, when the external list is changed (for example, the list is operated by multiple threads), The notifyDataSetChanged API of the adapter is not called in time, causing an error in the next update.

Solution:

In the adapter, do not assign values with the = value directly. Use the following two methods to re-allocate the memory:

1: list. clear, list. addall.

2: arraylist. clone.

------------------------------------------------------------------------

Android error: Channel is unrecoverably broken and will be disposed!

Analysis:

When using some methods, the input parameters are incorrect or the format is incorrect. Example: Integer. parseInt ("")

Solution:

Locate the cause of the problem, make a judgment first, and then pass the value.

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.