code: public String getString(String key, String defaultValue) throws ClassCastException {
  
  		return sharedPreferences.getString(key, (defaultValue == null) ? "" : defaultValue);
  	}
docs: Retrieve a String value from the preferences.
  
  @param key
  The name of the preference to retrieve.
  @param defaultValue
  value to return when a key does not exists.
  
  @return the preference value if it exists, or defValue. Throws ClassCastException if there is a preference with this name that is not a String.
  
  @Throws ClassCastException : When a value exists in given key but it's not a string
  @see android.content.SharedPreferences#getString(String, String)