Java tutorial
//package com.java2s; import java.util.Map; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; public class Main { public static void saveData(SharedPreferences sp, Map<String, String> datas) { Editor editor = sp.edit(); for (Map.Entry<String, String> entry : datas.entrySet()) { editor.putString(entry.getKey(), entry.getValue()); } editor.commit(); } }