该Resources.getColor(int id)方法已被弃用.
@ColorInt
@Deprecated
public int getColor(@ColorRes int id) throws NotFoundException {
return getColor(id, null);
}
Run Code Online (Sandbox Code Playgroud)
我该怎么办?
android android-resources android-mnc android-6.0-marshmallow
使用:
buildToolsVersion "22.0.1",
targetSdkVersion 22在我的gradle文件中.
我发现有用的getResources().getColor(R.color.color_name)是不推荐使用的.
我应该用什么呢?