dump Current SharedPreferences - Android Android OS

Android examples for Android OS:SharedPreferences

Description

dump Current SharedPreferences

Demo Code


//package com.java2s;

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 dumpCurrentSharedPrerence(SharedPreferences pref) {
        Map<String, ?> map = pref.getAll();
        Iterator<String> ite = map.keySet().iterator();
        while (ite.hasNext()) {
            String key = ite.next();
            Log.d(TAG, "dump " + key + " : " + String.valueOf(map.get(key)));
        }//from  w  w w .  ja  v a2  s  . c  o m
    }
}

Related Tutorials