3 回答
![?](http://img1.sycdn.imooc.com/54584f8f00019fc002200220-100-100.jpg)
TA贡献1825条经验 获得超6个赞
假设首选项是world_readable,这可能会奏效:
final ArrayList<HashMap<String,String>> LIST = new ArrayList<HashMap<String,String>>();
// where com.example is the owning app containing the preferences
Context 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());
}
![?](http://img1.sycdn.imooc.com/5458478b0001f01502200220-100-100.jpg)
TA贡献1789条经验 获得超8个赞
- 3 回答
- 0 关注
- 356 浏览
添加回答
举报