java.lang.RuntimeException: Unable to start activity ComponentInfo
异常:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.william/com.william.ResultActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x14
解决:TextView 对象中有一个方法为setText(param) ,当你传入一个int类型的值时,代码是不会报错的,但是当你运行着程序的时候,就会报出上面的错误。上网查了一些资料,最后知道为什么会有这样的错误出现,因为这是由于Android 会认为你传入的 int 型的数值是某个 resource 的 id ,那运行时就会出错。
myResult.setText(lastValue+"")代码,如果只myResult.setText(lastValue)写的话,那么这个lastValue值就是一个int类型的值了,那么只需要在后面加上一个空的字符串就可以了。
==================
但是我并无以上网友介绍的问题,我的问题是:
intent = new Intent(PerformanceTestMainActivity.this, PrinterTestActivity.class);
this.startActivity(intent);
就因为这个。唉,什么原理?
java.lang.RuntimeException: Unable to start activity ComponentInfo的更多相关文章
- 转载java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.spinner/com.example.spinner.MainActivity}: java.lang.NullPointerException
今天学习Android开发突然遇到了这个问题,查阅了很多资料,并且对集中原因进行了分析. 错误信息字符串:java.lang.RuntimeException: Unable to start act ...
- Java.lang.RuntimeException: Unable to instantiate activity ComponentInfo
如果你更新了ADT的新版本,而工程文件中使用了其他的jar包,也可能会出现"java.lang.RuntimeException: Unable to instantiate activit ...
- java.lang.RuntimeException: Unable to instantiate activity ComponentInfo异常总结
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo异常总结 做android开发的可能都碰到"j ...
- java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ex.activity/com.ex.activity.LoginActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ex.activity/com.ex.activity.L ...
- java.lang.RuntimeException: Unable to start activity ComponentInfo……AppCompat does not support the current theme features
Android测试时出现闪退的问题,出现了如下所示异常: java.lang.RuntimeException: Unable to start activity ComponentInfo{thon ...
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}
Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPoi ...
- android studio调试报错:java.lang.RuntimeException: Unable to start activity ComponentInfo
报错信息: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.pro_u_loc/com.e ...
- java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.love5/com.example.love5.Main11Activity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.
若有 java.lang.RuntimeException和 java.lang.NullPointerException: Attempt to invoke virtual method 'voi ...
- Android java.lang.RuntimeException: Unable to instantiate activity ComponentInfo 特殊异常
本来是不想写的,因为这个异常太常见了,而且也容易处理.但是还是决定记录一下,因为之前遇到过,没留心,今天又遇到了,苦逼了,想了好大一会儿才想起来. 通常容易找的就不写了,今天写个特殊的. 现象:当你在 ...
随机推荐
- 加密传输SSL协议6_验证公钥
如上图所示,我怎么能确定我手里的公钥就是我心中的接收方的公钥呢?怎么防止被钓鱼呢? 解决的办法就是引入一个第三方,一个权威机构,一个我们都相信的机构. 验证公钥,Digital Certificate ...
- redis 错误。
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Com ...
- 汇编写hello world
.global main main: mov ip, sp stmfd sp!, {fp, ip, lr} sub fp, ip, # ldr r0, =he mov lr, pc b printf ...
- libcurl编译
下载: git://github.com/bagder/curl.git openssl: openssl编译 for linux or mingw:./buildconf./configure ...
- NOI2014 Day2
NOI2014 Day2 动物园 题目描述:给出一个字符串(长度为\(Len\)),设\(num[i]\)为字符串的前\(i\)个字符构成的子串(\(A\))中,满足\(A\)的前\(L\)个字符既是 ...
- [LeetCode][Python]Roman to Integer
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'https://oj.leetcode.com/problems/roman-t ...
- nodejs运用passport和passport-local分离本地登录
var express = require('express'); var cookieParser = require('cookie-parser'); var bodyParser = requ ...
- 关于使用WKWebViewJavascriptBridge报错的问题
Error message: Undefined symbols for architecture arm64: "_OBJC_CLASS_$_WKWebViewJavascriptBrid ...
- 多个Activity之间的切换与数据交互
总结 两个activity之间切换我概括的分为两步: 1. 代码实现切换操作.2.配置中声明另外一个acitivity! 1. 代码实现切换操作 显示定义一个intent 对象,Intent 这个类的 ...
- WPF 采用Border创建圆角
通过设置可以创建圆角border的CornerRadius属性其边框呈现圆角样式 代码: <Border Height="50" Background="Red&q ...