首页 > 移动平台 > 详细

Android: java.lang.ClassCastException: android.widget.imageView cannot be cast to android.widget.textView异常解决

时间:2015-09-04 18:28:31      阅读:508      评论:0      收藏:0      [点我收藏+]

有时在修改xml文件时,全报这种错误,这个应该是缓存没得到及时更新导致的,可以通过以下方法解决:

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 app, and more commonly classCastException(s), which happen when Eclipse switches your Views‘ ids around.

A few solutions to that problem:

Clean your project.

Modify an xml layout file and save.

Delete your R file. (Don‘t worry it will 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 be cast to android.widget.textView异常解决

原文:http://www.cnblogs.com/mxm2005/p/4782104.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!