From 579cf4e85e4ce825eaca9494821f0c369f5ab37c Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 24 May 2013 09:06:44 -0700 Subject: Add in a check to make sure instance is valid --- .../src/github/daneren2005/dsub/activity/MainActivity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'subsonic-android/src/github') diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/MainActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/MainActivity.java index d1c22fea..6ab62662 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/MainActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/MainActivity.java @@ -269,7 +269,12 @@ public class MainActivity extends SubsonicActivity { editor.putString(Constants.PREFERENCES_KEY_PASSWORD + 1, "guest"); editor.putInt(Constants.PREFERENCES_KEY_SERVER_INSTANCE, 1); editor.commit(); - } + } + if(prefs.getInt(Constants.PREFERENCES_KEY_SERVER_INSTANCE, -1) < 0) { + SharedPreferences.Editor editor = prefs.edit(); + editor.putInt(Constants.PREFERENCES_KEY_SERVER_INSTANCE, 0); + editor.commit(); + } } private void showInfoDialog() { -- cgit v1.2.3