Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { private static final String SP_NAME = "login_data"; public static void delete(Context context) { SharedPreferences sp = getSP(context); SharedPreferences.Editor editor = sp.edit(); editor.clear().commit(); } private static SharedPreferences getSP(Context context) { return context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE); } }