码迷,mamicode.com
首页 > 移动开发 > 详细

android(eclipse)新手常见问题总结(一)

时间:2016-03-19 00:50:20      阅读:537      评论:0      收藏:0      [点我收藏+]

标签:

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;或者是拼写错误

android(eclipse)新手常见问题总结(一)

标签:

原文地址:http://www.cnblogs.com/zzy-frisrtblog/p/5294070.html

(1)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!