Android Lib Project中生产的R文件内,都不是常量。

/* AUTO-GENERATED FILE.  DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found.  It * should not be modified by hand. */public final class R {    public static final class string {        public static int action_settings=0x7f050001;        public static int app_name=0x7f050000;        public static int hello_world=0x7f050002;    }}


Android Project中生产的R文件内,都是常量

/* AUTO-GENERATED FILE.  DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found.  It * should not be modified by hand. */public final class R {    public static final class string {        public static final int action_settings=0x7f050001;        public static final int app_name=0x7f050000;        public static final int hello_world=0x7f050002;    }}


所以当你的项目中有用到switch的地方,同时条件又用到了 R 中的常量时,将此project转成lib project的话就会报错。要求你将 switch-case 换成 if-else。



As of ADT 14, resource fields cannot be used as switchcases. Invoke this fix to get more information.

Android Lib Project与Android Project中R文件的区别_第1张图片

更多相关文章

  1. Android OKhttp 上传文件袋参数
  2. Android:本地json文件解析
  3. Android调用系统下载服务下载文件
  4. android上传文件至服务器
  5. Android写文件到Sd卡的一般过程

随机推荐

  1. android4.0去掉锁屏和休眠 Power键按钮
  2. android的日期格式化 android.text.forma
  3. Android::整理基础之—— startActivityFor
  4. Android关于获取时间的记录(小结)
  5. Android源码中的单例模式
  6. android传感器sensor
  7. 【winows7+android-ndk-r9+Cygwin 】coco
  8. 调用Android系统“应用程序信息(Applicati
  9. android之requestWindowFeature详解
  10. android 设置应用程序 默认值