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