Android开发常出现的警告

1.META-INF/xfire/services.xml中 No grammar constraints (DTD or XML schema) detected for the document.
选项是说,如果语法未定义时,会提示这个问题!!

dtd验证是xml的规范,这个警告信息说明xml缺少头部,这个警告信息不会造成什么影响。
方法一:加上头部后就不会出现警告信息
类似头部如下:
[html] view plaincopyprint?
01.<!DOCTYPE hibernate-configuration PUBLIC
02."-//Hibernate/Hibernate Configuration DTD 3.0//EN"
03."http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

方法二:

工具栏:windows => preferences => xml => xml files => validation => Indicate when no grammar is specified:选择Ignore即可。
(具体设置请看:示例1)
然后警告消息就没了。

2.edittext控件中的警告:This text field does not specify an inputType or a hint
原因:没有设置editText的inputtype属性
例如:
android:hintText为空时显示的文字提示信息,可通过textColorHint设置提示信息的颜色android:inputType设置文本的类型,用于帮助输入法显示合适的键盘类型。

3.配置文件中 <uses-sdk处警告 :Not targeting the latest versions of Android; compatibility modes apply. Consider testing and
updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details.
(警告的原因详解见示例2)
意思是:建议你更新android SDK版本,可以使用eclipse(前提是安装adt插件)更新。
例如:如果你用的是4.4的版本 android:targetSdkVersion="18",将18改为19!(要求你后边的参数与模拟机的版本对应参数相同即可)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值