Exemplo n.º 1
0
        // Do the job of deletion
        private void DeleteNotificationImpl(ProgressDialog progressDialog, List <String> ids)
        {
            // We delete the notifications
            if (_gcstuffs.DeleteNotifications(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());
                }
                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());
            }
        }