Android Open Source - checkin Settings Fragment






From Project

Back to project page checkin.

License

The source code is released under:

# License Copyright ? 2014 Sam Whited Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ?Software??), to deal ...

If you think the Android project checkin 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.samwhited.checkin;
/* www  . jav a2  s .  co m*/
import android.os.Bundle;
import android.preference.EditTextPreference;
import android.preference.Preference;
import android.preference.PreferenceFragment;

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

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

    // Show the current server pref as the summary text.
    final EditTextPreference serverPref = (EditTextPreference) findPreference("pref_server");
    if (serverPref != null) {
      serverPref.setSummary(serverPref.getText());
      serverPref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {

        /**
         * Called when a Preference has been changed by the user. This is
         * called before the state of the Preference is about to be updated and
         * before the state is persisted.
         *
         * @param preference The changed Preference.
         * @param newValue   The new value of the Preference.
         * @return True to update the state of the Preference with the new value.
         */
        @Override
        public boolean onPreferenceChange(final Preference preference,
                          final Object newValue) {
          final String nv = (String)newValue;
          preference.setSummary(nv);
          return true;
        }
      });
    }
  }
}




Java Source Code List

com.samwhited.checkin.CheckInActivity.java
com.samwhited.checkin.CheckInDB.java
com.samwhited.checkin.CheckInFragment.java
com.samwhited.checkin.CheckInHandler.java
com.samwhited.checkin.CheckInListAdapter.java
com.samwhited.checkin.CheckInListFragment.java
com.samwhited.checkin.CheckInListItem.java
com.samwhited.checkin.CheckInListLoader.java
com.samwhited.checkin.CheckInList.java
com.samwhited.checkin.CheckInOpenHelper.java
com.samwhited.checkin.IconSpinnerAdapter.java
com.samwhited.checkin.SettingsActivity.java
com.samwhited.checkin.SettingsFragment.java
com.samwhited.checkin.database.CheckInDB.java
com.samwhited.checkin.database.CheckInOpenHelper.java
com.samwhited.checkin.model.CheckIn.java
com.samwhited.checkin.util.CheckInPreferences.java
com.samwhited.checkin.util.Formatting.java
com.samwhited.checkin.util.GeoJSON.java
com.samwhited.checkin.util.NetworkUtils.java