Java tutorial
//package com.java2s; import android.content.SharedPreferences; import java.util.ArrayList; import java.util.List; public class Main { private static List<String> prefsClean = new ArrayList<String>(); public static void cleanPrefs(SharedPreferences sharedPrefs) { SharedPreferences.Editor editor = sharedPrefs.edit(); for (String key : prefsClean) { editor.remove(key); } editor.apply(); } }