【发布时间】:2021-11-27 17:23:10
【问题描述】:
如何从字符串等资源中设置某些字段的默认值。因为我想为不同的语言设置值
@ColumnInfo(defaultValue = "") // R.string.someword
private String publisher;
尝试时:
@ColumnInfo(defaultValue = Resources.getSystem().getString(android.R.string.someword))
private String publisher;
得到以下错误
Attribute value must be constant
【问题讨论】:
标签: java android android-room