Android Eclipse Debug Report Java.lang.ClassCastException exception

Source: Internet
Author: User

ImageView a position in a layout file before the button is first placed

No error in compiling code

and adjust the position of both.

Compile the report again with the following error

Exception hint the button type cannot be converted to the ImageView type why do I get such an error, I obviously did not let them convert between.

It turns out that the compilation of Eclipse is based on the mechanism of time stamp judgment.
So when you press build all, some eclipse thinks that a class with no time stamp changes will not be compiled.
So you can clean it and compile it first. At this point eclipse will clean up all the previously compiled information and compile it.

After re-compiling the front and back positions of the two controls, you can remove the compiled. class file from Project->clean.

Then compile again, no error, complete.

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.