今天遇到一个错误也不知道怎么回事,上网搜了一下;

出现的问题是:java.lang.ClassCastException:android.widget.Button cannot be cast to android.widget.ImageView

解决的方法是:

  1. Clean 你的项目.(点击eclipse上面的project然后clean然后选择你要clean的项目)
  2. 修改一个xml文件,然后保存(稍微动一下,保存)
  3. 删除 R 文件. (build project 之后会自动生成).

java.lang.ClassCastException:android.widget.Button cannot be cast to android.widget.ImageView的更多相关文章

  1. 关于android使用ksoap2报Caused by: java.lang.ClassCastException: org.ksoap2.SoapFault cannot be cast to org.ksoap2.serialization.SoapObject

    Caused by: java.lang.ClassCastException: org.ksoap2.SoapFault cannot be cast to org.ksoap2.serializa ...

  2. java.lang.ClassCastException: oracle.sql.CLOB cannot be cast to oracle.sql.CLOB

    错误现象: [framework] 2016-05-26 11:34:53,590 -INFO  [http-bio-8080-exec-7] -1231863 -com.dhcc.base.db.D ...

  3. java.lang.ClassCastException: oracle.sql.TIMESTAMP cannot be cast to java.sql.Timestamp

    http://stackoverflow.com/questions/13269564/java-lang-classcastexception-oracle-sql-timestamp-cannot ...

  4. java.lang.ClassCastException: sun.proxy.$Proxy11 cannot be cast to分析

    报这个错,只有一个原因,就是你转化的类型不对. 如果你的类是一个单实体类,也就是没有继承或是接口别的类. public class HjmServiceImpl {} 那么这样写就可以: HjmSer ...

  5. java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.ProgressBar$SavedState

    java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.Progress ...

  6. java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.TextView

    最近在学习drawerLayout时,遇到这个bug.如下示: java.lang.ClassCastException: android.widget.RelativeLayout cannot b ...

  7. java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.L(转)

    09-09 10:19:59.979: E/AndroidRuntime(2767): FATAL EXCEPTION: main09-09 10:19:59.979: E/AndroidRuntim ...

  8. java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText

    Caused by: Java.lang.ClassCastException: Android.widget.TextView cannot be cast to android.widget.Ed ...

  9. 安卓出现错误: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText

    Caused by: Java.lang.ClassCastException: Android.widget.TextView cannot be cast to android.widget.Ed ...

随机推荐

  1. 【转载】【selenium+Python WebDriver】之selenium的定位以及切换frame(iframe)

    感谢CSDN:huilan_same大神 网页地址:http://blog.csdn.net/huilan_same/article/details/52200586

  2. ClassNotFoundException Log

    Studio 运行时异常: Error:Execution failed for task ':app:compileDebugJavaWithJavac'.> Compilation fail ...

  3. .NET Winform 将引用的dll文件集成到exe中(转)

    Winform程序经常需要引用一些第三方dll文件,这些dll在发布后与exe文件保存在同一目录下,虽然将dll文件集成到exe中会增大文件尺寸,但程序目录会相对整洁. 下面介绍一种比较简单的集成方法 ...

  4. 九度OJ 1036:Old Bill (老比尔) (基础题)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:2691 解决:1432 题目描述: Among grandfather's papers a bill was found.     72 ...

  5. 3行代码 多元线性方程组 rank=4 多元-一元 降元

    对于线性方程组Ax=b 对A和b执行同样的一串行初等运算, 那么该方程组的解集不发生变化. [未知-已知   高阶--低阶] http://mathworld.wolfram.com/CramersR ...

  6. 经常遇到js的面试题

    大家都知道在面试的时候,很多前端的必须要问的就是js的问题,最近我们公司也有很多这样的面试,我提了一些个问题,还有我面试的时候面试官面试我的问题汇总,也有百度的别人的,希望对那些刚进入这个行业的有一些 ...

  7. Spring自定义配置--ConfigurationProperties

    自定义配置的变量名: 在 *.properties 里面定义特定的变量 server.port=9000 amazon.associateId=habuma-20 建立Properties文件制定特定 ...

  8. org.apache.catalina.Lifecycle

    org.apache.catalina.Lifecycle start() *  ----------------------------- *  |                         ...

  9. SecureCRT连接VMWare中Linux

    SecureCRT连接vmvare虚拟机ubuntu的前提条件1.   使用主机可以ping通虚拟机,或虚拟机可以ping通主机2.   虚拟机已经开启ssh服务,可以使用sudo apt-get i ...

  10. Java for LeetCode 124 Binary Tree Maximum Path Sum

    Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. ...