I\'m creating Shared Preferences as follows
preferences = getSharedPreferences(\"text\", 0); final Editor editor = preferences.edit(); String s1 = serverIP.
Try contains(String key) Accorting to the Javadocs,
contains(String key)
Checks whether the preferences contains a preference. Returns true if the preference exists in the preferences, otherwise false.