我有两个问题:
我已经在values-ms中获得了翻译 我真的需要这个感谢
答案 0 :(得分:0)
我找到了答案
String[] language= { "English", "Chinese (Simplified)", "Bahasa Malaysia"};
ArrayAdapter<String> adapter = new ArrayAdapter<String
(this,android.R.layout.simple_spinner_item,language);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
Configuration config = new Configuration();
Locale applang = new Locale ("ms");
switch (arg2){
case 0:
config.locale = Locale.ENGLISH;
break;
case 1:
config.locale = Locale.SIMPLIFIED_CHINESE;
break;
case 2:
config.locale = applang;
break;
default:
config.locale = Locale.ENGLISH;
break;
}
getResources().updateConfiguration(config, null);
}
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
});