【发布时间】:2016-01-28 21:25:22
【问题描述】:
怎么了? 我正在尝试提取 strings.xml 中使用的字符串 但我得到错误:
Error:(64, 72) error: non-static method getString(int) cannot be referenced from a static context
代码:
private static String file_url = "http://xxxx.yy/" + getString(R.string.next_update_id);
【问题讨论】:
-
你的“getString”方法在哪里?
-
xxxxx 来自 strings.xml -
哎呀,忘了是安卓了。
-
没问题,感谢您的宝贵时间