【发布时间】:2017-01-26 13:49:03
【问题描述】:
我的应用程序是这样工作的:
public static String formatForUI(Calendar today, Calendar date) {
if (today.get(Calendar.YEAR) == date.get(Calendar.YEAR)) {
if (today.get(Calendar.DAY_OF_YEAR) == date.get(Calendar.DAY_OF_YEAR)) {
return "Today";
}
return currentYearDateFormat(date.getTimeInMillis());
} else {
return format(date.getTimeInMillis());
}
}
我希望“今天”是一个字符串,所以我在 strings.xml 中有它
<resources>
<string name="today">Today</string>
</resources>
我还有 es\strings.xml
<resources>
<string name="today">Hoy</string>
</resources>
我已尝试使用 getResources(),但它不起作用。我该怎么做?
【问题讨论】:
-
“但它不起作用”定义不起作用。
-
它说“无法解析符号”