Search in sources :

Example 1 with PreferenceScreen

use of android.preference.PreferenceScreen in project nmid-headline by miao1007.

the class SupportPreferenceFragment method addPreferencesFromIntent.

public void addPreferencesFromIntent(Intent intent) {
    requirePreferenceManager();
    try {
        Method m = PreferenceManager.class.getDeclaredMethod("inflateFromIntent", Intent.class, PreferenceScreen.class);
        m.setAccessible(true);
        PreferenceScreen screen = (PreferenceScreen) m.invoke(mPreferenceManager, intent, getPreferenceScreen());
        setPreferenceScreen(screen);
    } catch (Exception ignored) {
    }
}
Also used : PreferenceScreen(android.preference.PreferenceScreen) Method(java.lang.reflect.Method)

Example 2 with PreferenceScreen

use of android.preference.PreferenceScreen in project nmid-headline by miao1007.

the class SupportPreferenceFragment method addPreferencesFromResource.

public void addPreferencesFromResource(int resId) {
    requirePreferenceManager();
    try {
        Method m = PreferenceManager.class.getDeclaredMethod("inflateFromResource", Context.class, int.class, PreferenceScreen.class);
        m.setAccessible(true);
        PreferenceScreen screen = (PreferenceScreen) m.invoke(mPreferenceManager, getActivity(), resId, getPreferenceScreen());
        setPreferenceScreen(screen);
    } catch (Exception ignored) {
    }
}
Also used : PreferenceScreen(android.preference.PreferenceScreen) Method(java.lang.reflect.Method)

Example 3 with PreferenceScreen

use of android.preference.PreferenceScreen in project nmid-headline by miao1007.

the class SupportPreferenceFragment method onSaveInstanceState.

public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    PreferenceScreen preferenceScreen = getPreferenceScreen();
    if (preferenceScreen != null) {
        Bundle container = new Bundle();
        preferenceScreen.saveHierarchyState(container);
        outState.putBundle(PREFERENCES_TAG, container);
    }
}
Also used : PreferenceScreen(android.preference.PreferenceScreen) Bundle(android.os.Bundle)

Example 4 with PreferenceScreen

use of android.preference.PreferenceScreen in project nmid-headline by miao1007.

the class SupportPreferenceFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    if (mHavePrefs) {
        bindPreferences();
    }
    mInitDone = true;
    if (savedInstanceState != null) {
        Bundle container = savedInstanceState.getBundle(PREFERENCES_TAG);
        if (container != null) {
            final PreferenceScreen preferenceScreen = getPreferenceScreen();
            if (preferenceScreen != null) {
                preferenceScreen.restoreHierarchyState(container);
            }
        }
    }
}
Also used : PreferenceScreen(android.preference.PreferenceScreen) Bundle(android.os.Bundle)

Example 5 with PreferenceScreen

use of android.preference.PreferenceScreen in project Signal-Android by WhisperSystems.

the class AppProtectionPreferenceFragment method initializePlatformSpecificOptions.

private void initializePlatformSpecificOptions() {
    PreferenceScreen preferenceScreen = getPreferenceScreen();
    Preference screenSecurityPreference = findPreference(TextSecurePreferences.SCREEN_SECURITY_PREF);
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH && screenSecurityPreference != null) {
        preferenceScreen.removePreference(screenSecurityPreference);
    }
}
Also used : PreferenceScreen(android.preference.PreferenceScreen) CheckBoxPreference(android.preference.CheckBoxPreference) Preference(android.preference.Preference)

Aggregations

PreferenceScreen (android.preference.PreferenceScreen)153 Preference (android.preference.Preference)68 ListPreference (android.preference.ListPreference)42 CheckBoxPreference (android.preference.CheckBoxPreference)38 PreferenceCategory (android.preference.PreferenceCategory)32 Bundle (android.os.Bundle)26 EditTextPreference (android.preference.EditTextPreference)24 Method (java.lang.reflect.Method)20 Intent (android.content.Intent)19 SharedPreferences (android.content.SharedPreferences)11 RingtonePreference (android.preference.RingtonePreference)9 Test (org.junit.Test)9 Context (android.content.Context)8 OnPreferenceClickListener (android.preference.Preference.OnPreferenceClickListener)8 TwoStatePreference (android.preference.TwoStatePreference)8 AlertDialog (android.support.v7.app.AlertDialog)8 OsmandApplication (net.osmand.plus.OsmandApplication)8 ArrayList (java.util.ArrayList)7 SuppressLint (android.annotation.SuppressLint)6 ComponentName (android.content.ComponentName)6