Back to project page introToDroid4ed.
The source code is released under:
GNU General Public License
If you think the Android project introToDroid4ed 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.introtoandroid.simplepreferences; /* w w w. java 2s. com*/ import android.content.SharedPreferences; import android.os.Bundle; // Second activity screen public class MoreSimplePreferencesActivity extends SuperSimplePreferencesActivity { @Override protected void onCreate(Bundle savedInstanceState) { // Set some prefs for this specific activity SharedPreferences settingsActivity = getPreferences(MODE_PRIVATE); if(settingsActivity.contains(PREFERENCE_STRING_NAME) == false) { SharedPreferences.Editor prefEditor = settingsActivity.edit(); prefEditor.putString(PREFERENCE_STRING_NAME, this.getLocalClassName()); prefEditor.putLong("SomeLong", java.lang.Long.MIN_VALUE); prefEditor.commit(); } super.onCreate(savedInstanceState); } @Override Class<?> GetTargetClass() { // Where the "Go to other activity" action will send us return SimplePreferencesActivity.class; } }