Java tutorial
//package com.java2s; import android.content.Context; import java.util.HashSet; import java.util.Set; public class Main { public static final String PREFS_NAME = "FavoriteMovies"; public static final String FAVORITIES = "favorities"; public static Set<String> getFavorities(Context c) { return c.getSharedPreferences(PREFS_NAME, 0).getStringSet(FAVORITIES, new HashSet<String>()); } }