Android Open Source - android H W Manager






From Project

Back to project page android.

License

The source code is released under:

GNU General Public License

If you think the Android project android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.nico.ha_manager;
//from   w  w  w  . ja va  2s  .  c o m
/* 
 * Author: Nico Alt
 * See the file "LICENSE.txt" for the full license governing this code.
 */

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.preference.PreferenceManager;
import android.text.TextUtils;

import java.util.Locale;

public class HWManager extends Application {
    private static void updateLanguage(Context c) {
        SharedPreferences prefs = PreferenceManager
                .getDefaultSharedPreferences(c);
        String lang = prefs.getString("locale_override", "");
        updateLanguage(c, lang);
    }

    private static void updateLanguage(Context c, String lang) {
        Configuration cfg = new Configuration();
        if (!TextUtils.isEmpty(lang))
            cfg.locale = new Locale(lang);
        else
            cfg.locale = Locale.getDefault();

        c.getResources().updateConfiguration(cfg, null);
    }

    @Override
    public void onCreate() {
        updateLanguage(this);
        super.onCreate();
    }
}




Java Source Code List

de.nico.ha_manager.HWManager.java
de.nico.ha_manager.activities.About.java
de.nico.ha_manager.activities.AddHomework.java
de.nico.ha_manager.activities.Main.java
de.nico.ha_manager.activities.Preferences.java
de.nico.ha_manager.activities.SubjectOffers.java
de.nico.ha_manager.activities.Subjects.java
de.nico.ha_manager.database.Helper.java
de.nico.ha_manager.database.Source.java
de.nico.ha_manager.helper.ActionBarWrapper.java
de.nico.ha_manager.helper.Homework.java
de.nico.ha_manager.helper.Subject.java
de.nico.ha_manager.helper.Utils.java