Merge "Fix bug in recurrent event dialog picker when setting monthly day of the week." into ics-ub-calendar-eggplant
diff --git a/src/com/android/calendar/CalendarColorPickerDialog.java b/src/com/android/calendar/CalendarColorPickerDialog.java
index 9427610..e72d196 100644
--- a/src/com/android/calendar/CalendarColorPickerDialog.java
+++ b/src/com/android/calendar/CalendarColorPickerDialog.java
@@ -173,6 +173,10 @@
     }
 
     private void saveColorKeys(Bundle outState) {
+        // No color keys to save, so just return
+        if (mColors == null) {
+            return;
+        }
         int[] colorKeys = new int[mColors.length];
         for (int i = 0; i < mColors.length; i++) {
             colorKeys[i] = mColorKeyMap.get(mColors[i]);
diff --git a/src/com/android/calendar/alerts/AlertActivity.java b/src/com/android/calendar/alerts/AlertActivity.java
index 6e9af6d..78733bd 100644
--- a/src/com/android/calendar/alerts/AlertActivity.java
+++ b/src/com/android/calendar/alerts/AlertActivity.java
@@ -253,7 +253,15 @@
     @Override
     protected void onStop() {
         super.onStop();
-        AlertService.updateAlertNotification(this);
+        // Can't run updateAlertNotification in main thread
+        AsyncTask task = new AsyncTask<Context, Void, Void>() {
+            @Override
+            protected Void doInBackground(Context ... params) {
+                AlertService.updateAlertNotification(params[0]);
+                return null;
+            }
+        }.execute(this);
+
 
         if (mCursor != null) {
             mCursor.deactivate();