Back to project page Taekwondo-Time-Tracker-Android.
The source code is released under:
Apache License
If you think the Android project Taekwondo-Time-Tracker-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.hackbitstudios.taekwondo_time_tracker_android; /*from w w w.j av a2 s . co m*/ import android.app.ActionBar; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceActivity; import android.view.MenuItem; public class SettingsActivity extends PreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Add back button to action bar ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); } @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); setupSimplePreferencesScreen(); } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == android.R.id.home) { this.finish(); return true; } return super.onOptionsItemSelected(item); } /** * Shows the simplified settings UI if the device configuration if the * device configuration dictates that a simplified, single-pane UI should be * shown. */ private void setupSimplePreferencesScreen() { // Add 'general' preferences. addPreferencesFromResource(R.xml.preferences); } /** * A preference value change listener that updates the preference's summary * to reflect its new value. */ private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object value) { // Get and store the preference on change String stringValue = value.toString(); preference.setSummary(stringValue); return true; } }; }