Android中报错:threadid=1: thread exiting with uncaught exception
来源:互联网 发布:mac的launchpad 编辑:程序博客网 时间:2024/05/20 08:24
今天写代码时遇到一个问题,在启动Activity时闪退,并且报错如下:threadid=1: thread exiting with uncaught exception (group=0x416298c8)。
1. 因为我在界面中用到了Switch组件,查资料说使用Switch时的版本最小要14。但是我改为android:minSdkVersion="14"后还是会老样子闪退。
2. 因为在界面文件中只用到了EditText和Switch组件,看来不是Switch的问题,再次回到程序来观察,发现是在加载Activity后界面还没有加载任何内容就闪退了,所以我怀疑还是初始化的问题。(网上有资料提示有UncaughtExceptionHandler进行异常捕获,但是我觉得这么一个简单的界面还是先查查代码,实在不行再用,当然以学习的角度来说还是应该多练习一下的)
再次检查代码,发现果然是初始化的时候有问题,我在给EditText的对象port赋值时写成了如下代码:port.setText(sp.getInt("port", 33002)); 原因就不说了,很弱智的错误,改为下面的代码就好了:port.setText(sp.getInt("port", 33002) + "");
记录一下这个错误,并再次提醒自己,以后写代码时每一步都要认真仔细点,如果在稍大点项目中因为这种小错误而影响程序是很痛苦的。
0 0
- Android中报错:threadid=1: thread exiting with uncaught exception
- threadid=1: thread exiting with uncaught exception
- (Android)threadid = 1:thread exiting with uncaught exception(group = 0x40015560)
- Android错误threadid=1: thread exiting with uncaught exception (group=0x416298c8)
- Android错误threadid=1: thread exiting with uncaught exception (group=0x416298c8)
- android studio 运行报错 W/ dalvikvm threadid=1 thread exiting with uncaught exception group=0x41c57c50
- Android 应用Crash Log在Logcat中消失的问题 threadid=1: thread exiting with uncaught exception
- android问题:11-24 01:57:06.230: W/dalvikvm(1325): threadid=1: thread exiting with uncaught exception (
- threadid=1: thread exiting with uncaught exception (group=0x40e40438)
- threadid=1: thread exiting with uncaught exception (group=0x416298c8)
- threadid=1: thread exiting with uncaught exception (group=0x40f11438)
- threadid=1: thread exiting with uncaught exception (group=0x416f2e00)
- W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41cb7c68)
- W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x419b4c50)
- 解决 threadid=1: thread exiting with uncaught exception (未测试)
- threadid=1: thread exiting with uncaught except...
- 开发中关于threadid=1: thread exiting with uncaught exception (group=0x40...)的错误
- 问题的解决: dalvikvm(12291): threadid=1: thread exiting with uncaught exception (group=0x417d6930)
- bzoj3670: [Noi2014]动物园
- 【swoole】关于信号量的总结
- zabbix监控mysql数据库(推荐这种方式:zabbix通过mpm监控mysql的环境搭建)
- scriptform 导出pdf文件
- C++如何显示结尾的0,而不是用科学计数法显示呢
- Android中报错:threadid=1: thread exiting with uncaught exception
- SQLSERVER 数据库性能的基本
- SQL语句BETWEEN
- java中强制类型转换的注意
- Http协议(下载笑话网页,Get方式解析json)
- 智能家居软硬件结合之手机控制电器(手机与Python后台交互)
- 阿里2017年-图形图像算法工程师-在线编程题目
- windows远程连接复制粘贴操作
- vmare Ubuntu 下Hadoop 开发环境搭建eclipse win10 远程连接 安装与问题处理