我是这样解决的,你觉得正确吗?
getColor(int id, Theme theme); getColor(R.color.green, getContext().getTheme());
其中“绿色”在res/colors.xml:
res/colors.xml
<color name="green">#FF00FF00</color>
android android-studio
android ×1
android-studio ×1