dump Current Shared Preference - Android android.content

Android examples for android.content:SharedPreferences

Description

dump Current Shared Preference

Demo Code

import java.util.Iterator;
import java.util.Map;

import android.content.SharedPreferences;
import android.util.Log;

public class Main {

  private static final String TAG = "AlarmUtil";

  public static void dumpCurrentSharedPreference(SharedPreferences pref) {
    Map<String, ?> map = pref.getAll();
    Iterator<String> ite = map.keySet().iterator();
    while (ite.hasNext()) {
      String key = ite.next();//from   w  w  w .  ja  v a 2  s .c om
      Log.d(TAG, "dump " + key + " : " + String.valueOf(map.get(key)));
    }
  }

}

Related Tutorials