1

I want to use Arabic language inside html tags in android application,
the html tags are in the strings.xml file and its works perfectly with English language,
when I added Arabic version of the strings.xml file every thing is OK but the html string becomes understandably language ??
I tried to add

<head>
    <meta http-equiv="Content-Type" ; content="text/html; charset=utf-8" ; />
</head>

but the problem still. how can I fix it ??

4

2 回答 2

1

是的,我找到了,
我必须在我的活动中以这种方式加载文本
aboutus.loadData(stringData, "text/html; charset=UTF-8", null);

于 2013-04-25T12:48:40.583 回答
0

您是否更改了设备的区域设置?

您的阿拉伯语字符串文件必须位于此值文件夹中。“价值观-ar”

在您的活动类中,通过应用程序的代码更改您的设备区域设置。您可以在菜单上调用它或按下按钮。

        String languageCode = "ar_EG";
    Resources res = getResources();
        DisplayMetrics dm = res.getDisplayMetrics();
        android.content.res.Configuration conf = res.getConfiguration();
        conf.locale = new Locale(languageCode.toLowerCase());
        res.updateConfiguration(conf, dm);
        // you need to restart activity so that this change take place
        startActivity(new Intent(this, MyActivity.class));
        finish();
于 2013-04-25T11:59:22.353 回答