Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.content.SharedPreferences; public class Main { private static Context context; private static final String PRIVATE_CACHE = "PRIVATE_CACHE"; public static void clear() { SharedPreferences preferences = getPrivateSharedPreference(); SharedPreferences.Editor editor = preferences.edit(); editor.clear(); editor.commit(); } public static SharedPreferences getPrivateSharedPreference() { return context.getSharedPreferences(PRIVATE_CACHE, Context.MODE_PRIVATE); } }