2014-02-09 45 views
0

我在android中找不到語言環境西班牙語。 更改語言。在android中的語言環境西班牙語

我發現:

setLocal(Locale.FRENCH); 
setLocal(Locale.ENGLISH); 

,但我能找到的西班牙語語言環境

private void setLocal(Locale locale) { 
    Resources res = getResources(); 
    Configuration conf = res.getConfiguration(); 
    conf.locale = locale; 
    res.updateConfiguration(conf, res.getDisplayMetrics()); 
    try { 
     Context context = this.createPackageContext(this.getPackageName(), 
       Context.CONTEXT_INCLUDE_CODE); 
     Intent intent = new Intent(context, MainActivity.class); 
     startActivity(intent); 
     finish(); 
    } catch (Exception e) { 
     e.printStackTrace(); 
    } 
} 

回答

0

public Locale (String language)會幫助你。

相關問題