Add language chooser

Implement limelight-stream/limelight-android#32.
This commit is contained in:
Ansa89
2014-11-24 11:47:02 +01:00
parent 444c4602c1
commit 99aa616188
9 changed files with 64 additions and 1 deletions

View File

@@ -87,6 +87,14 @@ 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("list_languages", "default");
if (!locale.equals("default")) {
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);