Skip to content

Instantly share code, notes, and snippets.

@mortenjust
Created September 10, 2015 23:55
Show Gist options
  • Save mortenjust/bec82a08c32fc950485f to your computer and use it in GitHub Desktop.
Save mortenjust/bec82a08c32fc950485f to your computer and use it in GitHub Desktop.
Check if preferences file exists #android
File f = new File(
"/data/data/your_application_package/shared_prefs/Name_of_your_preference.xml");
if (f.exists())
Log.d("TAG", "SharedPreferences Name_of_your_preference : exist");
else
Log.d("TAG", "Setup default preferences");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment