Java tutorial
//package com.java2s; import android.content.Context; public class Main { public static final String SP_NAME = "refresh_listview"; public static String getString(Context context, String key, String defaultValue) { return context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE).getString(key, defaultValue); } }