Skip to content
Browse files

small changes on prefs

  • Loading branch information...
1 parent c585c14 commit 164c9e6fd32efc344694c79b250aa3eefefe761d Carles Sentis committed Oct 11, 2012
Showing with 6 additions and 14 deletions.
  1. +6 −14 src/com/codeskraps/lolo/PrefsActivity.java
View
20 src/com/codeskraps/lolo/PrefsActivity.java
@@ -69,9 +69,7 @@ protected void onCreate(Bundle savedInstanceState) {
chkSync = (CheckBoxPreference) findPreference(Constants.SHOW_SYNC);
chk24 = (CheckBoxPreference) findPreference(Constants.HOUR24);
lstInterval = (ListPreference) findPreference(Constants.INTERVAL);
- Preference prefAbout = (Preference) findPreference(Constants.ABOUT);
-
- prefAbout.setOnPreferenceClickListener(this);
+ ((Preference) findPreference(Constants.ABOUT)).setOnPreferenceClickListener(this);
}
@Override
@@ -122,8 +120,8 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
if (BuildConfig.DEBUG) Log.d(TAG, "onSharedPreferenceChanged");
if (key.equals(Constants.HOUR24)) {
- if (prefs.getBoolean(Constants.HOUR24, true))
- 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)) {
@@ -162,18 +160,10 @@ public boolean onKeyDown(int keyCode, KeyEvent event) {
@Override
public void onBackPressed() {
+ if (BuildConfig.DEBUG) Log.d(TAG, "onBackPressed");
// This will be called either automatically for you on 2.0
// or later, or by the code above on earlier versions of the
// platform.
- if (BuildConfig.DEBUG) Log.d(TAG, "onBackPressed");
- resultIntent();
- finish();
- return;
- }
-
- private void resultIntent() {
- if (BuildConfig.DEBUG) Log.d(TAG, "resultIntent");
-
if (Constants.CONFIGURE_ACTION.equals(getIntent().getAction())) {
Intent intent = getIntent();
Bundle extras = intent.getExtras();
@@ -187,6 +177,8 @@ private void resultIntent() {
}
}
sendBroadcast(new Intent(Constants.FORCE_WIDGET_UPDATE));
+
+ super.onBackPressed();
}
@Override

0 comments on commit 164c9e6

Please sign in to comment.
Something went wrong with that request. Please try again.