Android Open Source - HastingsMobileAndroid Settings Activity






From Project

Back to project page HastingsMobileAndroid.

License

The source code is released under:

Apache License

If you think the Android project HastingsMobileAndroid 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 edu.hastings.hastingscollege;
//ww w  .j  a  v a2  s. c  o  m
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Bundle;
import android.preference.PreferenceActivity;

/**
 * This preference activity has in its manifest declaration an intent filter for
 * the ACTION_MANAGE_NETWORK_USAGE action. This activity provides a settings UI
 * for users to specify network settings to control data usage.
 */
public class SettingsActivity extends PreferenceActivity
        implements
            OnSharedPreferenceChangeListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Loads the XML preferences file.
        addPreferencesFromResource(R.xml.preferences);
    }

    @Override
    protected void onResume() {
        super.onResume();

        // Registers a callback to be invoked whenever a user changes a preference.
        getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
    }

    @Override
    protected void onPause() {
        super.onPause();

        // Unregisters the listener set in onResume().
        // It's best practice to unregister listeners when your app isn't using them to cut down on
        // unnecessary system overhead. You do this in onPause().
        getPreferenceScreen()
                .getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
    }

    // Fires when the user changes a preference.
    @Override
    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
        // Sets refreshDisplay to true so that when the user returns to the main
        // activity, the display refreshes to reflect the new settings.
        MainActivity.mShouldNotify = false;
    }
}




Java Source Code List

edu.hastings.hastingscollege.BuildConfig.java
edu.hastings.hastingscollege.BuildConfig.java
edu.hastings.hastingscollege.MainActivity.java
edu.hastings.hastingscollege.SettingsActivity.java
edu.hastings.hastingscollege.SodexoXmlParser.java
edu.hastings.hastingscollege.SplashActivity.java
edu.hastings.hastingscollege.adapter.ContactsDataModel.java
edu.hastings.hastingscollege.adapter.CustomEContactsAdapter.java
edu.hastings.hastingscollege.adapter.CustomEventsAdapter.java
edu.hastings.hastingscollege.adapter.CustomSodexoWeekMenuAdapter.java
edu.hastings.hastingscollege.adapter.HelperExpandListView.java
edu.hastings.hastingscollege.adapter.TabsPagerAdapter.java
edu.hastings.hastingscollege.connection.Connection.java
edu.hastings.hastingscollege.connection.HttpAuthenticationDialog.java
edu.hastings.hastingscollege.connection.ServiceHandler.java
edu.hastings.hastingscollege.googleanalytics.MyApplication.java
edu.hastings.hastingscollege.map_db.LocationsDB.java
edu.hastings.hastingscollege.model.Data.java
edu.hastings.hastingscollege.model.EventModel.java
edu.hastings.hastingscollege.model.MapLocation.java
edu.hastings.hastingscollege.navdrawerfragments.FragmentAbout.java
edu.hastings.hastingscollege.navdrawerfragments.FragmentAthletics.java
edu.hastings.hastingscollege.navdrawerfragments.FragmentBroncoboard.java
edu.hastings.hastingscollege.navdrawerfragments.FragmentCampusEvents.java
edu.hastings.hastingscollege.navdrawerfragments.FragmentDiningHall.java
edu.hastings.hastingscollege.navdrawerfragments.FragmentEmergencyContacts.java
edu.hastings.hastingscollege.navdrawerfragments.FragmentHome.java
edu.hastings.hastingscollege.navdrawerfragments.FragmentMap.java
edu.hastings.hastingscollege.navdrawerfragments.FragmentTwitter.java
edu.hastings.hastingscollege.tabfragments.BreakfastFragment.java
edu.hastings.hastingscollege.tabfragments.DinnerFragment.java
edu.hastings.hastingscollege.tabfragments.LunchFragment.java
edu.hastings.hastingscollege.tabfragments.SingleMenuItemNutritionFactsActivity.java
edu.hastings.hastingscollege.tabfragments.SodexoMenu.java