在Android library中不能使用switch-case语句访问资源ID,
Androidstudio 会报错误:
resoure IDs cannot be used in a switch statement in android library modules,
把switch - case 替换为if else 就可以了,当模块以library 使用的时候,在R 资源中 ids都不是final,不能使用。
只有主程序的R 文件生成的是final 常量,可以正常使用switch 。