Android, string resource not found

后端 未结 8 664
悲&欢浪女
悲&欢浪女 2020-12-20 11:45

I\'m working on an App, and I am getting weired errors. I put in some String resource in res/values/strings and saved it. Now If I want to access it in an Activ

8条回答
  •  别那么骄傲
    2020-12-20 12:34

    I also met this problem and it is very wired at first. 1: I make sure I import the correct R into my class 2: I checked R.java in the gen folder and the resource id is there. 3: I cleaned my project and remove from my phone and relaunch it the exception still there.

    Finally I found the reason: I just added my resource string into the strings.xml in language-specific folder(say values-zh) but missed it in the default strings.xml in the default values folder.

    then it is solved.

提交回复
热议问题