假设首选项是world_readable,这可能会奏效:final ArrayList<HashMap<String,String>> LIST = new ArrayList<HashMap<String,String>>();// where com.example is the owning app containing the preferencesContext myContext = createPackageContext("com.example", Context.MODE_WORLD_WRITEABLE); SharedPreferences testPrefs = myContext.getSharedPreferences("test_prefs", Context.MODE_WORLD_READABLE); Map<String, ?> items = testPrefs .getAll();for(String s : items.keySet()) { // do something like String value = items.get(s).toString());}