0

我在我的 android 应用程序中使用 unicode 字符。因为我希望它们成为外部资源,所以我在 strings.xml 中创建了字符串数组,如下所示

<string-array name="geez_first_chars">
    <item >"\u1200"</item>
    <item >"\u1208"</item>
    <item >"\u1210"</item>
    <item >"\u1218"</item>
    ....
</string-array>

然后我在我的 Java 代码中访问它们,如下所示:

String fidels[] = getResources().getStringArray(R.array.geez_first_chars);

但是,有运行时错误,请帮我解决这个问题。

4

1 回答 1

0

我自己解决了上述问题。运行时错误是由调用 getResources() 引起的...将“String fidels []”放在后面,我将调用移至 onCreate(),它运行良好。

干杯!

于 2013-03-01T14:57:13.853 回答