相关疑难解决方法(0)

在Android 6.0 Marshmallow(API 23)上弃用了getColor(int id)

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

686
推荐指数
12
解决办法
27万
查看次数

如何将android资源int转换为字符串.例如:android.R.string.cancel?

如何从此资源中获取字符串值"cancel"int:android.R.string.cancel?

谢谢

android android-resources

24
推荐指数
2
解决办法
2万
查看次数