From 70c0fbe1ea7b46de0793f6fa6253a5634afd6199 Mon Sep 17 00:00:00 2001 From: nabiltntn Date: Tue, 17 Feb 2015 10:18:00 +0000 Subject: [PATCH] Fix Android support configuration to avoid ClassNotFoundException --- plugin.xml | 3 ++- src/android/applicationPreferences.java | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugin.xml b/plugin.xml index e64344c..cf89c2c 100644 --- a/plugin.xml +++ b/plugin.xml @@ -17,7 +17,8 @@ - + + diff --git a/src/android/applicationPreferences.java b/src/android/applicationPreferences.java index ca1f99f..c82af68 100644 --- a/src/android/applicationPreferences.java +++ b/src/android/applicationPreferences.java @@ -44,7 +44,8 @@ public boolean execute(String action, JSONArray args, } else if (action.equals("set")) { String key = args.getString(0); String value = args.getString(1); - if (sharedPrefs.contains(key)) { + //we should avoid this condition because it doesnt allow adding new + //if (sharedPrefs.contains(key)) { Editor editor = sharedPrefs.edit(); if ("true".equals(value.toLowerCase()) || "false".equals(value.toLowerCase())) { editor.putBoolean(key, Boolean.parseBoolean(value)); @@ -54,10 +55,12 @@ public boolean execute(String action, JSONArray args, editor.commit(); callbackContext.success(); return true; - } else { + /* + } else { callbackContext.error("No such property called " + key); return false; } + */ } else if (action.equals("load")) { JSONObject obj = new JSONObject(); Map prefs = sharedPrefs.getAll();