java.lang.ClassCastException: android.widget.ImageButton异常处理
在调程序时总是出现异常关闭的现象,log显示:
03-26 07:58:09.528: E/AndroidRuntime(398): Caused by: java.lang.ClassCastException: android.widget.ImageButton
XML中:

JAVA文件中:

解决方法:
把两个控件类型改成一致的就可以了。
java.lang.ClassCastException: android.widget.ImageButton异常处理的更多相关文章
- java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.TextView
最近在学习drawerLayout时,遇到这个bug.如下示: java.lang.ClassCastException: android.widget.RelativeLayout cannot b ...
- 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 ...
- 安卓出现错误: 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 ...
- java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.widget.AbsListView$LayoutParams
java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.w ...
- java.lang.ClassCastException:android.widget.Button cannot be cast to android.widget.ImageView
今天遇到一个错误也不知道怎么回事,上网搜了一下: 出现的问题是:java.lang.ClassCastException:android.widget.Button cannot be cast to ...
- java.lang.ClassCastException android.widget.RelativeLayout LayoutParams 异常
1.在xml布局文件如下所示: <RelativeLayout android:layout_width="match_parent" android:layout_heig ...
- Exception: java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams
RelativeLayout title_bg = (RelativeLayout)FTU_Bluetooth.this.findViewById(R.id.titlebar); LinearLayo ...
- Caused by: java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams
最近,在android中用代码动态改变某种布局(组件)的高度时,会遇到如题所示的类转换异常.上网查了一下,如下所示: These supply parameters to the parent of ...
- Android: java.lang.ClassCastException: android.widget.imageView cannot be cast to android.widget.textView异常解决
有时在修改xml文件时,全报这种错误,这个应该是缓存没得到及时更新导致的,可以通过以下方法解决: Eclipse tends to mess up your resources every now a ...
随机推荐
- bzoj 3834 [Poi2014]Solar Panels 数论分块
3834: [Poi2014]Solar Panels Time Limit: 20 Sec Memory Limit: 128 MBSubmit: 367 Solved: 285[Submit] ...
- Python --Redis Hash操作
一.Redis Hash操作 Redis 数据库hash数据类型是一个string类型的key和value的映射表,适用于存储对象.Redis 中每个 hash 可以存储 232 - 1 键值对(40 ...
- SpringBoot(三) :Spring boot 中 Redis 的使用
前言: 这一篇讲的是Spring Boot中Redis的运用,之前没有在项目中用过Redis,所以没有太大的感觉,以后可能需要回头再来仔细看看. 原文出处: 纯洁的微笑 SpringBoot对常用的数 ...
- SpringCloud学习(6)——Hystrix熔断器
分布式系统面临的问题 复杂的分布式体系结构中的应用程序有数十个依赖关系, 每个依赖关系在某些时刻不可避免的失败. 服务雪崩效应 多个微服务调用的时候, 假设微服务A调用微服务B和微服务C, 微服务B和 ...
- div 画table尝试
.left { float: left; } .table { border: solid 1px black; width: 750px; } .tr { width: 100%; height: ...
- Excel公式
多个IF =IF(ISNUMBER(SEARCH("lz",E7)),"lz", IF(ISNUMBER(SEARCH("zch",E7)) ...
- poi对EXCEL的操作(一)
(原创自己这段时间对poi的研究心得) 一.基础的对象 1.wookbook工作簿 创建工作簿 wookbook XSSFWorkbook类的构造方法 XSSFWorkbook ...
- Redis实战(六)管道
https://www.cnblogs.com/huangxincheng/p/6212406.html
- GridControl详解(一)原汁原味的表格展示
Dev控件中的表格控件GridControl控件非常强大.不过,一些细枝末节的地方有时候用起来不好找挺讨厌的.使用过程中,多半借助Demo和英文帮助文档.网上具体的使用方法也多半零碎.偶遇一个简单而且 ...
- 【leetcode 简单】第十八题 爬楼梯
假设你正在爬楼梯.需要 n 阶你才能到达楼顶. 每次你可以爬 1 或 2 个台阶.你有多少种不同的方法可以爬到楼顶呢? 注意:给定 n 是一个正整数. 示例 1: 输入: 2 输出: 2 解释: 有两 ...