Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.content.SharedPreferences; public class Main { public static final String USER_INFO = "user_info"; public static final String USER_INFO_OTHER = "user_info_other"; public static final String QQ = "qq"; public static void deleteLogin(Context context) { SharedPreferences preferences = context.getSharedPreferences(USER_INFO, Context.MODE_PRIVATE); preferences.edit().clear().commit(); SharedPreferences preferences1 = context.getSharedPreferences(USER_INFO_OTHER, Context.MODE_PRIVATE); preferences1.edit().clear().commit(); SharedPreferences preferences2 = context.getSharedPreferences(QQ, Context.MODE_PRIVATE); preferences.edit().clear().commit(); } }