Android SharedPreferences Example
A primitive data type values only stored in SharedPreferences. If stored we can use SharedPreferences values across the application. You can download source code here. Following steps:- This class used for get value from SharedPreferences and put value to SharedPreferences. package com.etr.sharedpreferenceexample; import android.app.Activity; import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class PreferenceActivity extends Activity { private SharedPreferences mPref; private SharedPreferences.Editor mPrefEdit; private EditText mText; private Button mGet, mPut; @Override protected void onCreate(Bundle savedInstanceState) { try { super.onCreate(savedInstanceState); setContentView(R.layout.activity_preference)...