Android 有关多国语言支持的相关属性。利用下面代码打印系统相关属性值。具体属性可以查文档。 package com.example; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; import android.widget.TextView; import org.w3c.dom.Text; import java.util.Locale; public class MyActivity extends Activity {
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Locale locale = this.getResources().getConfiguration().locale;
StringBuffer sb = new StringBuffer();
sb.append("locale.toString():" + locale.toString());
sb.append("\nlocale.getCountry():" + locale.getCountry());
sb.append("\nlocale.getDisplayCountry():" + locale.getDisplayCountry());
sb.append("\nlocale.getDisplayLanguage():" + locale.getDisplayLanguage());
sb.append("\nlocale.getDisplayName():" + locale.getDisplayName());
sb.append("\nlocale.getDisplayVariant():" + locale.getDisplayVariant());
sb.append("\nlocale.getISO3Country():" + locale.getISO3Country());
sb.append("\nlocale.getISO3Language():" + locale.getISO3Language());
sb.append("\nlocale.getLanguage():" + locale.getLanguage());
sb.append("\nlocale.getVariant():" + locale.getVariant());
TextView textView = (TextView)this.findViewById(R.id.text);
textView.setText(sb.toString());
this.setTitle("local对象");
}
}

更多相关文章

  1. 使用意图在Activity之间传递数据小插曲__传递自定义的序列化对象
  2. Android学习笔记之mainfest文件中android属性 .
  3. Android 属性动画(Property Animation) 使用详解

随机推荐

  1. [Android(安卓)Pro] 调用系统相机和图库,
  2. android 数据操作 2011.8.27
  3. 解决 Android(安卓)Studio : minSdkVersi
  4. Android(安卓)插拔sd广播
  5. Android:msm8909:添加自定义脚本
  6. android 对话框 popupWindow
  7. 【Android(安卓)UI】色板
  8. Android中跳转到系统设置界面大全
  9. Android复习笔记(10) -对话框的使用
  10. Windows7中搭建Android(安卓)x86_64及arm