mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-04 15:06:08 +00:00
Merge pull request #33 from Ansa89/language_chooser
Add language chooser
This commit is contained in:
@@ -87,6 +87,15 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
String locale = prefs.getString(PreferenceConfiguration.LANGUAGE_PREF_STRING,
|
||||
PreferenceConfiguration.DEFAULT_LANGUAGE);
|
||||
if (!locale.equals(PreferenceConfiguration.DEFAULT_LANGUAGE)) {
|
||||
Configuration config = new Configuration(getResources().getConfiguration());
|
||||
config.locale = new Locale(locale);
|
||||
getResources().updateConfiguration(config, getResources().getDisplayMetrics());
|
||||
}
|
||||
|
||||
// We don't want a title bar
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user