From b620b59a95bbdfe25989698272ccf7cfdd1660f9 Mon Sep 17 00:00:00 2001 From: Jonas Kalderstam Date: Tue, 28 Oct 2014 22:46:06 +0100 Subject: [PATCH] Fix error handling Signed-off-by: Jonas Kalderstam --- app/src/main/java/com/nononsenseapps/build/Config.java | 3 ++- .../main/java/com/nononsenseapps/notepad/prefs/SyncPrefs.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nononsenseapps/build/Config.java b/app/src/main/java/com/nononsenseapps/build/Config.java index 6a8d48865..c07980877 100644 --- a/app/src/main/java/com/nononsenseapps/build/Config.java +++ b/app/src/main/java/com/nononsenseapps/build/Config.java @@ -55,7 +55,8 @@ public static Properties getProperties(final Context context) { } public static String getGtasksApiKey(final Context context) { - return getProperties(context).getProperty(KEY_GTASKS_API_KEY); + return getProperties(context).getProperty(KEY_GTASKS_API_KEY, + "AIzaSyCAjRk2GfPARlIU3JsaEiExLMtj_rdN2i4"); } public static String getKeyDropboxSyncPublic(final Context context) { diff --git a/app/src/main/java/com/nononsenseapps/notepad/prefs/SyncPrefs.java b/app/src/main/java/com/nononsenseapps/notepad/prefs/SyncPrefs.java index 267f0c9db..9831a4845 100644 --- a/app/src/main/java/com/nononsenseapps/notepad/prefs/SyncPrefs.java +++ b/app/src/main/java/com/nononsenseapps/notepad/prefs/SyncPrefs.java @@ -168,6 +168,7 @@ public boolean onPreferenceClick(Preference preference) { // Disable prefs if this is not correct build findPreference(KEY_SYNC_ENABLE).setEnabled( + null != Config.getGtasksApiKey(getActivity()) && !Config.getGtasksApiKey(getActivity()).contains(" ")); // SD Card