在的strings.xml
添加新项目后,往往他们不开始在Android的Studio的preVIEW立即工作。
After adding new items in strings.xml
, quite often they don't start working immediately in Android Studio's Preview.
Couldn't resolve resource @string/faq_customer_service
preVIEW看起来是这样的:
Preview looks like this:
我显然试图重新生成项目,甚至执行摇篮干净assembleDebug
,但它似乎并没有帮助。在仿真器和放大器;实际设备新添加字符串资源做的工作。
I've obviously tried to re-build the project, and even run gradle clean assembleDebug
, but it doesn't seem to help. On emulator & real device the newly-added string resources do work.
任何伎俩,迫使Android的工作室来重新加载资源,使正确的文本显示在preVIEW?
Any trick to force Android Studio to reload the resources so that the correct texts show up in Preview?
我到目前为止发现的唯一可靠的办法就是重装项目/重启Android的工作室。
The only reliable way I've found so far is reloading the project / restarting Android Studio.
最快做到这一点的方法是文件和RARR;无效缓存/重新启动...→只需重新启动
Quickest way to do that is File → Invalidate caches / Restart... → Just Restart.
随意张贴更好的解决方案!
Feel free to post better solutions!