This is a helper function for an app's debug or development drawer and is designed to be pasted into an
Activity. It retrieves all files from
shared_prefs and allows the user to choose which files to inspect or reset to default values. It is extremely helpful when testing one-shot scenarios such as for hints or onboarding, etc.
It assumes that the files are named in a consistent and predictable way -- more specifically by prefixing them with the application ID as mentioned here. For maximum consistency, this assumes that files are named similar to how the system names the default
SharedPreferences file (
All the application-specific preferences files are displayed in an
AlertDialog. For readability, the application ID is stripped out.