1:getResource.getColor(R.color.color_name)----------------------------Android SDK 升級到 23 之後, getResource.getColor(R.color.color_name) 過時,可以使用新加入的方法 ContextCompat.getColor(context, R.color.color_name)
2:getResource.getDrawable()--------替代方法:ContextCompat.getDrawable(context,R.drawable.drawable)
本文介绍了 Android SDK 升级到版本 23 后,一些 API 的过时及替代方案,包括 getResource 方法中 getColor 和 getDrawable 的替代方法 ContextCompat.getColor 和 ContextCompat.getDrawable。
1527

被折叠的 条评论
为什么被折叠?



