开发者

Android's strings.xml giving a nullpointer on retrieval.

Perhaps one of you great gods/goddesses of Android may see it fit to help a mere peasent as myself.

If I use

String myNewAppId = "34";

I am 开发者_开发技巧good. If I use

String myNewAppId = this.getString(R.string.appid);

or

String myNewAppId = getResources.getString(R.string.appid);

setting my strings.xml file to

<string name="appid">34</string>

I show no errors yet I crash with a nullpointerException.


Sometimes Eclipse does not update the string resource. Try cleaning and rebuilding your project manually to force it to be updated.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜