Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.preference.PreferenceManager; public class Main { private static final String KEY_PREF_ACCESS_TOKEN = "access_token"; private static final String KEY_PREF_USER_NAME = "user_name"; public static final void removeAccessToken(Context context) { PreferenceManager.getDefaultSharedPreferences(context).edit().remove(KEY_PREF_USER_NAME) .remove(KEY_PREF_ACCESS_TOKEN).commit(); } }