Android SharedPreferences Delete clearSharedPreferences(Context context)

Here you can find the source of clearSharedPreferences(Context context)

Description

clear Shared Preferences

Declaration

public static void clearSharedPreferences(Context context) 

Method Source Code

//package com.java2s;

import android.content.Context;
import android.content.SharedPreferences;

import android.preference.PreferenceManager;

public class Main {
    public static void clearSharedPreferences(Context context) {
        SharedPreferences prefs = PreferenceManager
                .getDefaultSharedPreferences(context);
        SharedPreferences.Editor editor = prefs.edit();
        editor.clear();//  w  w  w  .  ja va 2s  .c  om
        editor.commit();
    }
}

Related

  1. deleteAllPreference(Context context)