Java Preference clearPreference(Object context)

Here you can find the source of clearPreference(Object context)

Description

clear Preference

License

Open Source License

Declaration

public static void clearPreference(Object context) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;

public class Main {
    private static Preferences prefs;

    public static void clearPreference(Object context) {
        try {/*from   ww w  .  j ava  2s  .  c  o m*/
            prefs = Preferences.userRoot().node(context.getClass().getName());
            prefs.clear();
        } catch (BackingStoreException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}

Related

  1. backingStoreAvailable(Preferences prefs)
  2. cambiarIdioma(String lang, String country)
  3. classFor(Object obj)
  4. count(Preferences preferences, String preferenceName)
  5. createNode(String path)
  6. hasEnv(String key, String value)
  7. initEnv(String key, String value)