1
Is there any easy way to see everything inside my SharedPreferences
?
Something like for example:
SharedPreferences prefs = this.getSharedPreferences( "user_access", Context.MODE_PRIVATE);
Log.i("SharedPreferences", prefs);
Update
With the help of @Piovezan I managed using the following code:
SharedPreferences prefs = this.getSharedPreferences( "user_access", Context.MODE_PRIVATE);
Map<String, ?> prefs_map = prefs.getAll();
Log.i("debug", prefs_map.toString());
If you look at The Sharedpreferences API, You’ll see there’s a dodo
getAll()
that returns aMap
with the key-value pairs contained in the preferences.– Piovezan
@Piovezan, why don’t you put it in answer? To me it answers the question.
– Wakim