简书链接:resourceIDscannotbeusedinaswitchstatementinAndroidlibrarym
文章字数:107,阅读全文大约需要1分钟
不懂直接翻译,意思是android 模块里面不能使用switch来判断resourceid ,
如何验证?

1
D:\newdev\meiyedana\radiogroupx\build\generated\source\r\debug\cn\qssq666\radiogroupx目录下的R文件
1
2
3
4
5
6
7
8
9
10
11
 public static final class attr {
public static int badgePadding = 0x7f040001;
public static int badgeRadius = 0x7f040002;
public static int badgetext = 0x7f040003;
public static int badgetextColor = 0x7f040004;
public static int badgetextSize = 0x7f040005;
public static int buttongravity = 0x7f040006;
public static int buttontextColor = 0x7f040007;
public static int buttontextSize = 0x7f040008;
public static int checkedButton = 0x7f040009;
}

如何快速替换??

1
case (.*)\:

被替换内容

1
}else if (attr == $1){