Android Open Source - AndroidSliderPreference Example Activity






From Project

Back to project page AndroidSliderPreference.

License

The source code is released under:

Copyright 2012 Jay Weisskopf Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software...

If you think the Android project AndroidSliderPreference 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 net.jayschwa.android.preference.SliderPreferenceExample;
//from  www .j  av  a  2  s  .  co  m
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceActivity;

// Deprecated PreferenceActivity methods are used for API Level 10 (and lower) compatibility
// https://developer.android.com/guide/topics/ui/settings.html#Overview
@SuppressWarnings("deprecation")
public class ExampleActivity extends PreferenceActivity implements
    SharedPreferences.OnSharedPreferenceChangeListener {

  protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    addPreferencesFromResource(R.xml.preferences);
    getPreferenceManager().getSharedPreferences()
        .registerOnSharedPreferenceChangeListener(this);
  }

  protected void onDestroy() {
    getPreferenceManager().getSharedPreferences()
        .unregisterOnSharedPreferenceChangeListener(this);
    super.onDestroy();
  }

  public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
      String key) {
  }
}




Java Source Code List

net.jayschwa.android.preference.SliderPreference.java
net.jayschwa.android.preference.SliderPreferenceExample.ExampleActivity.java