在Android库中不能使用switch-case语句访问资源ID
2017-05-05 10:22
309 查看
在Android项目中,点击事件一般都是实现接口OnClickListener 的onClick,然后通过switch-case语句访问资源id.如下图
但是在写Android依赖库时候发现居然不能使用报错了
非常莫名其妙的问题呢,不过错误提示说的很明白了
the constants are not final in a library project.
lib库中的常量没有final修饰,所以必须修改,修改方法也给出,修改成if else就好
但是在写Android依赖库时候发现居然不能使用报错了
非常莫名其妙的问题呢,不过错误提示说的很明白了
the constants are not final in a library project.
lib库中的常量没有final修饰,所以必须修改,修改方法也给出,修改成if else就好
相关文章推荐
- 在Android library中不能使用switch-case语句访问资源ID
- 在Android library中不能使用switch-case语句访问资源ID的原因分析及解决方案
- 在Android library中不能使用switch-case语句访问资源ID的原因分析及解决方案
- Android library中为什么不能使用switch-case语句访问资源ID
- 在Android library中不能使用switch-case语句访问资源ID的原因分析及解决方案
- 在Android library中不能使用switch-case语句访问资源ID的原因分析及解决方案
- 在Android library中不能使用switch-case语句访问资源ID的原因分析及解决方案
- 在Android library中不能使用switch-case语句访问资源ID的原因分析及解决方案
- 在Android library中不能使用switch-case语句访问资源ID的原因分析及解决方案
- Android Studio 库文件中使用使用switch-case语句访问资源ID报错
- android 打library 库 不能使用switch/case语句
- 在Android library中不能使用switch-case语句报错及解决方案
- android library工程中使用switch_case语句,调用资源文件的id出现错误的原因分析及解决方法
- android 打library 库 不能使用switch/case语句
- 题目:求1+2+…+n,要求不能使用乘除法、for、while、if、else、switch、case等关键字以及条件判断语句(A?B:C)
- 题目:求1+2+…+n,要求不能使用乘除法、for、while、if、else、switch、case等关键字以及条件判断语句(A?B:C)。
- 求 1+2+3+..n不能使用乘除法、 for 、 while 、 if 、 else 、 switch 、 case 等关键字以及条件判断语句
- 求1+2+…+n,要求不能使用乘除法、for、while、if、else、switch、case 等关键字以及条件判断语句
- 求1+2+3+...+n,要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句(A?B:C)。
- 求1+2+3+...+n,要求不能使用乘除法,for,while,if,else,switch,case等关键字以及条件判断语句