Java tutorial
//package com.java2s; import java.util.Set; import android.content.Context; import android.content.SharedPreferences; public class Main { private static final String SHARED_NAME = "SharedPreferences"; public static Set<String> getStringSet(Context context, String key, Set<String> defValues) { SharedPreferences sp = getSharedPreferences(context); return sp.getStringSet(key, defValues); } private static SharedPreferences getSharedPreferences(Context context) { return context.getSharedPreferences(SHARED_NAME, Context.MODE_PRIVATE); } }