今天在写一个小例子时,处了一个错误让我找了一下午,下面是错误代码
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Log.i(tag, "-----");
SharedPreferences share = super.getSharedPreferences(file, SharedActivity.MODE_PRIVATE);
/* SharedPreferences.Editor editor = share.edit();
editor.putString("author", "niufc");
editor.putInt("age", 28);
editor.commit();*/
Log.i(tag, "ddddd");
this.authorTextView =(TextView)super.findViewById(R.id.authortext);
Log.i(tag, "uuuuu");
this.ageTextView = (TextView)super.findViewById(R.id.agetext);
this.authorTextView.setText("作者:"+share.getString("author", "没有纸"));
Log.i(tag, "mmmm");
this.ageTextView.setText(share.getInt("age", 0));//错误点
}
红字的为错误代码,正确代码为
this.ageTextView.setText(""+share.getInt("age", 0));//错误点
原来setText()方法的参数,当他读第一代码不是方法内正确参数时,他就出错
错误代码见附件图片
- 大小: 29.5 KB
分享到:
相关推荐
DBeaver (dbeaver-ce-21.2.5-linux.gtk.aarch64-nojdk.tar.gz)适用于Linux ARM 64 位(不含 Java 的 zip)。DBeaver 是一个通用的数据库管理工具和 SQL 客户端,支持 MySQL, PostgreSQL, Oracle, DB2, MSSQL, ...
eclipse scala插件,第二部分
附带三个jar包:org.eclipse.emf.transaction.jar,org.eclipse.emf.validation.jar,org.eclipse.emf.workspace.jar。解压后,将jars文件夹里的3个jar包复制到eclipse安装目录的plugins文件夹下,然后 activiti-...
【解决方案】错误连接数据库 [mysql1] : org.pentaho.di.core.exception.KettleDatabaseException: Error occurred while trying to connect to the database Driver class 'sun.jdbc.odbc.JdbcOdbcDriver' could ...
import org.jboss.logging.Logger; public class MyClass { private static final Logger logger = Logger.getLogger(MyClass.class); public void myMethod() { logger.info("This is an informational ...
/tmp/ /jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory occurred.. 以root用户运行:rpm -Uvh libXp-1.0.0-8.i386.rpm xhost + 问题解决
An error ocCurred while completing process -java.lang.reflect.InvocationTargetException (1).关闭 Eclipse (2).copy %AXIS2_HOME%\lib\ 下的 backport-util-concurrent-3.1.jar 和 geronimo-stax-api_1.0_...
在使用MyEclipse进行Java开发的过程中,可能会遇到一个常见的问题:“An internal error occurred during: 'Calculating completion proposals...'”。这个错误通常伴随着`java.lang.NullPointerException`异常,...
Universal-USB-Installer-2.0.1.4a
The PXF JDBC Connector now supports pushdown of OR and NOT logical filter operators when specified in a JDBC named query or in an external table query filter condition. PXF supports writing Avro-...
ORA-27302: failure occurred at: skgxpvfymmtu ORA-27303: additional information: MTU could not be verified. Did not receive valid message. These errors are caused by more aggressive checking ...
99-02-vcredist_x86.exe
其他hadoop-eclipse-plugin都是盖的,真正解决 An internal error occurred during: "Connecting to DFS test". org/apache/commons/configuration/Configuration 注意版本为:hadoop 1.2.0 eclipse Version: Mars.1...
用于安装windows tap虚拟网卡。虚拟网卡设备必备。上网必备
在Eclipse3.5用Axis2中创建wsdl文件时,在最后一步出现如下错误: An error ocCurred while completing process -java.lang.reflect.InvocationTargetException 解决用到的jar包,两个jar包在backport-util-...
在Oracle数据库系统中,"ORA-01036:非法的变量名/编号"是一个常见的错误,通常出现在PL/SQL代码或者SQL查询语句中,当你尝试使用一个不正确或者未定义的变量时,Oracle数据库会抛出这个错误。这个错误可能是由于...
报错如下 报错: ORA-12170:TNS connect timeout occurred 第一反应是监听没开: 1. 测试了一下, 连接超时没用ping 通 C:\Users\Administrator>tnsping brorcl TNS Ping Utility for 64-bit Windows: Version 11.2...
- FIX: In the method TFlexPanel.ResizeSelection exception occurred when the number of selected items changed while the method was running. - ADD: Added the method TFlexControl.DoNeedHint - allows ...
2. **兼容性**:此版本的SLF4J可以很好地与Java 6及更高版本兼容,并且对Eclipse和IntelliJ IDEA等开发环境有良好的支持。 3. **桥接机制**:SLF4J提供桥接模块,如log4j-over-slf4j,用于将其他日志框架的调用转换...
#### ORA-00104: Full Divisional Lockout Occurred 发生了完全部门锁定。这可能是由于并发控制机制的问题或锁管理器的问题。 #### ORA-00105: Dispatcher Not Found 未找到调度器。这可能是由于配置错误或服务管理...