Code example for SharedPreferences.Editor: Saving app preferences

Methods: clear, commit

0
    } 
     
    public static void clear() { 
    	SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(Director.getInstance().getContext());
    	Editor ed = p.edit();
    	ed.clear();
    	ed.commit();
    } 
     
    public static void remove(String name) {
    	SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(Director.getInstance().getContext());
    	Editor ed = p.edit();
    	ed.remove(name);
    	ed.commit();
    } 
}