Code example for SharedPreferences

Methods: getAll

0
	 * @return HashMap<String,?> all preferences 
	 */ 
	public HashMap<String,?> getAllPrefs() {
		Log.d(LOG_TAG, "getAllPrefs");
		HashMap<String,?> allPrefs = null;
		allPrefs = (HashMap<String, ?>) this.sharedPrefs.getAll();
		return allPrefs;
	} 
	 
	/** 
	 * Get all of the preference names 
	 *  
	 * @return Set<String> of preference names 
	 */ 
	public Set<String> getPrefNames() {
		Log.d(LOG_TAG, "getPrefNames");
		Set<String> prefNames = null;
		 
		HashMap<String,?> allPrefs  = this.getAllPrefs();
		prefNames = allPrefs.keySet();
		return prefNames;