Android Open Source - LicenseModuleChecker-Client-Android Preference Control






From Project

Back to project page LicenseModuleChecker-Client-Android.

License

The source code is released under:

<?xml version="1.0" encoding="UTF-8"?> <module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4"> <comp...

If you think the Android project LicenseModuleChecker-Client-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 com.asynhkm.productchecker;
/*w w w .  j  a v a 2 s  .c o m*/
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.preference.PreferenceActivity;

import java.util.Locale;

/**
 * Created by Hesk on 24/11/2014.
 */
public class PreferenceControl extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
    public static void updateLanguage(Context context, String idioma) {
        if (!"".equals(idioma)) {
            if ("castella".equals(idioma)) {
                idioma = "es_ES";
            } else if ("catala".equals(idioma)) {
                idioma = "ca_ES";
            }
            Locale locale = new Locale(idioma);
            Locale.setDefault(locale);
            Configuration config = new Configuration();
            config.locale = locale;
            context.getResources().updateConfiguration(config, null);
        }
    }

    @Override
    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) {
        getPreferenceScreen().getSharedPreferences()
                .registerOnSharedPreferenceChangeListener(this);
    }
}




Java Source Code List

com.asynhkm.example.ApplicationTest.java
com.asynhkm.example.MainExample.java
com.asynhkm.productchecker.ApplicationTest.java
com.asynhkm.productchecker.PreferenceControl.java
com.asynhkm.productchecker.Checker.CheckerCB.java
com.asynhkm.productchecker.Checker.CheckerTask.java
com.asynhkm.productchecker.Checker.HKMCheckerPlugable.java
com.asynhkm.productchecker.Checker.param.java
com.asynhkm.productchecker.Util.JSONReader.java
com.asynhkm.productchecker.Util.RootDialog.java
com.asynhkm.productchecker.Util.Tool.java
com.asynhkm.productchecker.schema.DataProductVersion.java
com.asynhkm.productchecker.schema.RDataDeserialize.java
com.asynhkm.productchecker.schema.RRDeserialize.java
com.asynhkm.productchecker.schema.ReturnData.java
com.asynhkm.productchecker.schema.ReturnResult.java
com.asynhkm.productchecker.schema.requestCheck.java