android(eclipse)新手常见问题总结(一)
2016-03-18 23:29
651 查看
1:jdk无法更新
进入工具里面手动获取镜像资源 并且改为强制
2:报错:This version of the rendering library is more recent than your version of AD
在布局预览中重新选择适合你的sdk的版本
3:当添加文本信息有黄色感叹号错误时或者报错(I18N] Hardcoded string "this is textview", should use @string resource)
可以在string 添加<string name="message1">Button 2</string> 然后在在布局里面引用android:text="@string/message1"
4:报错:No Launcher activity found! The launch will only sync the application package on the device!
活动注册中intent-filter 出了问题或者是其中的sdk版本不对
5:报错:Premature end of file. 试一下先保存再运行
6:报错:The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (new OnclickListener(){})
检查拼写是否错误
7:添加progressdialog控件时如果setcancelabel设为了false则一定要在代码中dismiss(—)来关闭对话框要不然一直存在无法取消无法退出程序
8:报错:[Accessibility] Missing contentDescription attribute on image
在一些没有文本显示的控件里,如imageView和imageButton等,ADT会提示你定义一个android:contentDescription属性,用来描述这个控件的作用
9:报错:Cannot make a static reference to the non-static field ViewHolder.leftMsg
第一种,可以把变量改成静态的。第二种,先实例化对象,然后使用对象名.变量名来调用即可(我就是因为直接用了类名来调用一直出错。。。zzz)问题
10:报错:OnClickListener cannot be resolved to a type
将“new OnClickListener”改为“new View.OnClickListener”,因为android版本升级后,将“OnClickListener”接口移到了View类中
或者是导入import android.view.View.OnClickListener;或者是拼写错误
进入工具里面手动获取镜像资源 并且改为强制
2:报错:This version of the rendering library is more recent than your version of AD
在布局预览中重新选择适合你的sdk的版本
3:当添加文本信息有黄色感叹号错误时或者报错(I18N] Hardcoded string "this is textview", should use @string resource)
可以在string 添加<string name="message1">Button 2</string> 然后在在布局里面引用android:text="@string/message1"
4:报错:No Launcher activity found! The launch will only sync the application package on the device!
活动注册中intent-filter 出了问题或者是其中的sdk版本不对
5:报错:Premature end of file. 试一下先保存再运行
6:报错:The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (new OnclickListener(){})
检查拼写是否错误
7:添加progressdialog控件时如果setcancelabel设为了false则一定要在代码中dismiss(—)来关闭对话框要不然一直存在无法取消无法退出程序
8:报错:[Accessibility] Missing contentDescription attribute on image
在一些没有文本显示的控件里,如imageView和imageButton等,ADT会提示你定义一个android:contentDescription属性,用来描述这个控件的作用
9:报错:Cannot make a static reference to the non-static field ViewHolder.leftMsg
第一种,可以把变量改成静态的。第二种,先实例化对象,然后使用对象名.变量名来调用即可(我就是因为直接用了类名来调用一直出错。。。zzz)问题
10:报错:OnClickListener cannot be resolved to a type
将“new OnClickListener”改为“new View.OnClickListener”,因为android版本升级后,将“OnClickListener”接口移到了View类中
或者是导入import android.view.View.OnClickListener;或者是拼写错误
相关文章推荐
- java 导出Excel
- java.sql.Exception:setString 只能处理少于 32766 个字符的字符串
- Java中String类(字符串操作)的10个常见问题和解决方法
- Java命名规范
- mac jdk原因导致 maven命令无法执行
- 【Android开发准备】Windows下JDK的安装与环境变量的配置
- JAVA面向对象之多态性
- 观察者模式学习以及jdk实现
- 关于java 异常捕捉 ( try catch finally ) 执行流程
- Java中Serializable接口和Cloneable接口
- 白话Spring(中级篇)---前端控制器
- java 类加载器
- Java 注解原理以及实例
- 2016蓝桥杯假期任务之《打印十字图》
- No_16_0316 Java基础学习第十九天
- java中异常的限制
- 将eclipse中项目的Text File Encoding设置成为GBK
- spring4+hibernate4+struts2项目整合的步骤及注意事项
- 可恶的Eclipse 一天崩几百遍我都不惊诧
- [疯狂Java]多线程:线程组、线程/组内异常处理