summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2014-04-21 18:15:33 +0800
committerMatt Garnes <matt@cyngn.com>2014-11-11 17:46:50 -0800
commit98e018fd3a84c917a8f21c3fb4bf361d6aad6211 (patch)
tree46b25cce94bd46cf1a312a812e12eef792de1936
parentc3992352fad30213bea1e05e81270fb303c1ec09 (diff)
downloadandroid_packages_apps_Calendar-98e018fd3a84c917a8f21c3fb4bf361d6aad6211.tar.gz
android_packages_apps_Calendar-98e018fd3a84c917a8f21c3fb4bf361d6aad6211.tar.bz2
android_packages_apps_Calendar-98e018fd3a84c917a8f21c3fb4bf361d6aad6211.zip
Calendar: The delete events option status changed after rotate screen
Calendar through LoadManager to query the total number of events, and update the delete events option status in onLoadFinished method. But this method will be called at the first time load data or data have changed, so can't update option status when rotating screen. Calls the initLoader function in onCreate and onResume ensure that the onLoadFinished can be callback. CRs-Fixed: 650667 Change-Id: Id96f28bf648de374fb5d2cb7e0827e072f5342bd
-rw-r--r--src/com/android/calendar/AllInOneActivity.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/calendar/AllInOneActivity.java b/src/com/android/calendar/AllInOneActivity.java
index 66394591..48613706 100644
--- a/src/com/android/calendar/AllInOneActivity.java
+++ b/src/com/android/calendar/AllInOneActivity.java
@@ -471,6 +471,9 @@ public class AllInOneActivity extends AbstractCalendarActivity implements EventH
prefs.registerOnSharedPreferenceChangeListener(this);
mContentResolver = getContentResolver();
+ if (getResources().getBoolean(R.bool.show_delete_events_menu)) {
+ getLoaderManager().initLoader(0, null, this);
+ }
}
private long parseViewAction(final Intent intent) {
@@ -595,6 +598,9 @@ public class AllInOneActivity extends AbstractCalendarActivity implements EventH
invalidateOptionsMenu();
mCalIntentReceiver = Utils.setTimeChangesReceiver(this, mTimeChangesUpdater);
+ if (getResources().getBoolean(R.bool.show_delete_events_menu)) {
+ getLoaderManager().initLoader(0, null, this);
+ }
}
@Override