Permalink
Browse files

Json parse fixed

  • Loading branch information...
1 parent 87f22f3 commit ce7d15ab5e1ea84e66c76eaf286e0207c81ad507 Carles Sentis committed Aug 5, 2012
Showing with 6 additions and 7 deletions.
  1. +4 −6 src/com/codeskraps/lolo/PrefsActivity.java
  2. +2 −1 src/com/codeskraps/lolo/Utils.java
@@ -122,8 +122,8 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
if (BuildConfig.DEBUG) Log.d(TAG, "onSharedPreferenceChanged");
if (key.equals(Constants.HOUR24)) {
- boolean hour24 = prefs.getBoolean(Constants.HOUR24, true);
- if (hour24) chk24.setSummary(getString(R.string.prefs24_summaryTwo));
+ if (prefs.getBoolean(Constants.HOUR24, true))
+ chk24.setSummary(getString(R.string.prefs24_summaryTwo));
else chk24.setSummary(getString(R.string.prefs24_summaryOne));
} else if (key.equals(Constants.ONCLICK)) {
@@ -157,7 +157,6 @@ public boolean onKeyDown(int keyCode, KeyEvent event) {
Log.d(TAG, "SDK < Eclair");
onBackPressed();
}
-
return super.onKeyDown(keyCode, event);
}
@@ -192,9 +191,8 @@ private void resultIntent() {
@Override
public boolean onPreferenceClick(Preference pref) {
- if (pref.getKey().equals(Constants.ABOUT)) {
+ if (pref.getKey().equals(Constants.ABOUT))
startActivity(new Intent(this, AboutActivity.class));
- }
- return false;
+ return true;
}
}
@@ -74,14 +74,15 @@ public static boolean getLolo() throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity()
.getContent(), "UTF-8"));
String json = reader.readLine();
+ Log.d(TAG, json);
reader.close();
JSONTokener tokener = new JSONTokener(json);
boolean lolo = false;
try {
JSONObject finalResult = new JSONObject(tokener);
- lolo = Boolean.getBoolean(finalResult.getString("open"));
+ lolo = finalResult.getBoolean("open");
Log.d(TAG, "lolo: " + lolo);
} catch (JSONException e) {
Log.e(TAG, e.getMessage());

0 comments on commit ce7d15a

Please sign in to comment.