Android Open Source - WhereIParked Settings Fragment






From Project

Back to project page WhereIParked.

License

The source code is released under:

GNU General Public License

If you think the Android project WhereIParked 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.cachirulop.whereiparked.fragment;
/*w w w . ja v a  2s .  c  o  m*/
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;

import com.cachirulop.whereiparked.R;
import com.cachirulop.whereiparked.manager.SettingsManager;

public class SettingsFragment
        extends PreferenceFragment
        implements SharedPreferences.OnSharedPreferenceChangeListener
{
    @Override
    public void onCreate (Bundle savedInstanceState)
    {
        super.onCreate (savedInstanceState);

        // Load the preferences from an XML resource
        addPreferencesFromResource (R.xml.preferences);
    }

    public void onSharedPreferenceChanged (SharedPreferences sharedPreferences,
                                           String key)
    {
        if (key.equals (SettingsManager.KEY_PREF_MAP_MODE)) {
            Preference connectionPref = findPreference (key);

            // Set summary to be the user-description for the selected value
            connectionPref.setSummary (SettingsManager.getMapModeDesc ());
        }

    }

    @Override
    public void onResume ()
    {
        super.onResume ();
        getPreferenceManager ().getSharedPreferences ().registerOnSharedPreferenceChangeListener (this);
    }

    @Override
    public void onPause ()
    {
        super.onPause ();
        getPreferenceScreen ().getSharedPreferences ().unregisterOnSharedPreferenceChangeListener (this);
    }
}




Java Source Code List

com.cachirulop.whereiparked.activity.MainActivity.java
com.cachirulop.whereiparked.activity.SettingsActivity.java
com.cachirulop.whereiparked.broadcast.BluetoothBroadcastReceiver.java
com.cachirulop.whereiparked.broadcast.ConnectivityBroadcastReceiver.java
com.cachirulop.whereiparked.common.ErrorDialogFragment.java
com.cachirulop.whereiparked.common.MessageHandler.java
com.cachirulop.whereiparked.common.Message.java
com.cachirulop.whereiparked.common.exception.ConfigurationException.java
com.cachirulop.whereiparked.common.exception.MapsForgeException.java
com.cachirulop.whereiparked.common.exception.WhereIParkedException.java
com.cachirulop.whereiparked.data.WhereIParkedDataHelper.java
com.cachirulop.whereiparked.entity.MapFile.java
com.cachirulop.whereiparked.entity.MapSubfile.java
com.cachirulop.whereiparked.fragment.SettingsFragment.java
com.cachirulop.whereiparked.manager.ContextManager.java
com.cachirulop.whereiparked.manager.IProgressListener.java
com.cachirulop.whereiparked.manager.MapFilesManager.java
com.cachirulop.whereiparked.manager.MapSubfilesManager.java
com.cachirulop.whereiparked.manager.MapsForgeManager.java
com.cachirulop.whereiparked.manager.ProgressDialogListener.java
com.cachirulop.whereiparked.manager.SettingsManager.java
com.cachirulop.whereiparked.preferences.BluetoothDevicePreference.java
com.cachirulop.whereiparked.provider.MapsForgeTileProvider.java
com.cachirulop.whereiparked.provider.TestMapForgeTileProvider.java