Back to project page dissertation-project.
The source code is released under:
MIT License
If you think the Android project dissertation-project 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.fyp.resilience.activity; /* ww w .j av a2 s . c o m*/ import android.os.Bundle; import android.preference.PreferenceActivity; import android.preference.PreferenceFragment; import android.preference.PreferenceManager; import android.view.MenuItem; import com.fyp.resilience.R; public class SettingsActivity extends PreferenceActivity { @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); getActionBar().setDisplayHomeAsUpEnabled(true); getFragmentManager() .beginTransaction() .replace(android.R.id.content, new ConnectionsPrefFragment()) .commit(); } /** * */ public static class ConnectionsPrefFragment extends PreferenceFragment { @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); PreferenceManager.setDefaultValues(getActivity(), R.xml.settings_pref_layout, false); addPreferencesFromResource(R.xml.settings_pref_layout); } } @Override public boolean onOptionsItemSelected(final MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); break; } return super.onOptionsItemSelected(item); } }