Android:java.lang.ClassCastException:android.widget.imageView cannot is cast to Android.widget.textView exception resolution

Source: Internet
Author: User

Sometimes when you modify the XML file, this error is reported, this should be caused by the cache is not updated in a timely manner, can be resolved by the following methods:

Eclipse tends to mess up your resources every now and then. This leads to some odd behavior such as strings and images being swapped all over your apps, and more commonly CLASSCASTEXC Eption (s), which happen when Eclipse switches your "IDs around.

A Few solutionsto that problem:

Clean your project.

Modify an XML layout file and save.

Delete your R file. (Don ' t worry it'll be automatically generated again).

Basically anything that makes your project rebuild and re-generate the R file.

url:http://stackoverflow.com/questions/11191040/ Android-java-lang-classcastexception-android-widget-imageview-cannot-be-cast-t

Android:java.lang.ClassCastException:android.widget.imageView cannot is cast to Android.widget.textView exception resolution

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.