Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { public static String g_sUserPref = "UserInfo"; public static String LoadAccountPwd(Context ctx) { String password = ""; try { SharedPreferences savePref = ctx.getSharedPreferences(g_sUserPref, ctx.MODE_PRIVATE); password = savePref.getString("Password", ""); } catch (Exception ex) { ex.printStackTrace(); } return password; } }