// Do the job of toggling private void ToggleNotificationImpl(ProgressDialog progressDialog, List <String> ids) { // We toggle the notifications if (_gcstuffs.ToggleNotifications(this, progressDialog, ids)) { // Kill progressdialog (we are in UI thread already, good) RunOnUiThread(() => progressDialog.Hide()); // Success, so we rebuild the notification list // This one will also create a progressdialog RunOnUiThread(() => Update()); // All right! if (_Canceled) { RunOnUiThread(() => Toast.MakeText(this, this.Resources.GetString(Resource.String.Canceled), ToastLength.Short).Show()); // Don't go to main activity !!! } else { RunOnUiThread(() => Toast.MakeText(this, this.Resources.GetString(Resource.String.Success), ToastLength.Short).Show()); } } else { // Kill progressdialog (we are in UI thread already, good) RunOnUiThread(() => progressDialog.Hide()); // Crap RunOnUiThread(() => Toast.MakeText(this, this.Resources.GetString(Resource.String.Error), ToastLength.Short).Show()); } }