Java tutorial
//package com.java2s; //License from project: Apache License import java.util.HashSet; import java.util.Set; import android.content.Context; import android.content.SharedPreferences; public class Main { private static final String PREF_FILE_APPS = "com.twinone.locker.prefs.apps"; public static Set<String> getLockedApps(Context c) { SharedPreferences sp = appsPrefs(c); return new HashSet<>(sp.getAll().keySet()); } public static SharedPreferences appsPrefs(Context c) { return c.getSharedPreferences(PREF_FILE_APPS, Context.MODE_PRIVATE); } }