我正在开发Android应用程序,其中我支持7种印度语言。 当我选择语言为印地语并执行Facebook帖子时,它在Facebook墙上没有显示印地语文本(全部为空白),但是当我用英文文本显示它然后显示所有文本。
所以任何人都可以指导我如何在Facebook墙上用其他语言显示帖子。
下面是我使用的代码
.setMessage("राष्ट्रीय")
.setName("Android Application.")
.setCaption("One App with 7 language support.")
.setDescription(
"This is dummy app")
.setPicture(
"http://xxxxx.xxxxx.xxx/img/cm/mainhp/logo.gif")
.setLink("https://www.google.com").build();
mSimpleFacebook.publish(feed, onPublishListener);
发布此消息后,我在Facebook墙页中收到消息
答案 0 :(得分:0)
3小时后找到我自己的解决方案
public static void updateLanguage(Context context, String code)
{
Locale locale = new Locale(code);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
context.getResources().updateConfiguration(config, context.getResources().getDisplayMetrics());
}
和onCreate调用的关键点是
Utils.updateLanguage(getApplicationContext(), "hi");
其中hi是印地语的语言代码。