clear Preference - Android android.content

Android examples for android.content:SharedPreferences

Description

clear Preference

Demo Code

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

public class Main {

  /**//from   w  w  w.j a v  a2s . c  om
   * Method clearPreference ...
   *
   * @param paramContext
   *          of type Context
   */
  public static void clearPreference(Context paramContext) {
    SharedPreferences.Editor localEditor = paramContext.getSharedPreferences("com.java2s.client", 0).edit();
    localEditor.clear();
    localEditor.commit();
  }

}

Related Tutorials