开发者

Strings in strings.xml are causing problems in Android

开发者 https://www.devze.com 2023-02-16 19:41 出处:网络
What can I do? I want to offer multilanguage versions, but for this I need every string in strings.xml...with Con开发者_JAVA技巧text.getString it isn\'t working because of non-static method in static

What can I do? I want to offer multilanguage versions, but for this I need every string in strings.xml...with Con开发者_JAVA技巧text.getString it isn't working because of non-static method in static class/method.

Strings in strings.xml are causing problems in Android

Strings in strings.xml are causing problems in Android


Then do this:

How can I get a resource content from a static context?


Oh I see what your trying to do.

The R.string.blah is just an int reference.

To get the actual string you need to do

Context.getResources().getString(R.string.blah);

Get String Resource

0

精彩评论

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