Beispiel #1
0
        public override void OnBackPressed()
        {
            alert.SetTitle("Sign out");
            alert.SetMessage("Are you sure you would like to sign out?");
            alert.SetPositiveButton("SignOut", signoutButton);
            alert.SetNegativeButton("Cancel", cancelButton);
            Dialog myDialog = alert.Create();

            myDialog.Show();
        }
Beispiel #2
0
        private void Delete(Entrega ent)
        {
            Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);

            alert.SetTitle("Tem certeza que deseja excluir esta ocorrência?");
            alert.SetPositiveButton("Sim", (senderAlert, args) =>
            {
                try
                {
                    var entrega = new EntregaManager();
                    entrega.Delete(ent);

                    //Intent myIntent = new Intent(this, typeof(Activity_Menu));
                    ////myIntent.PutExtra("mensagem", entrega.mensagem);
                    //SetResult(Android.App.Result.Ok, myIntent);

                    Toast.MakeText(this, entrega.mensagem, ToastLength.Short).Show();
                    FillList(dataEmissao);
                }
                catch (Exception ex)
                {
                    Toast.MakeText(this, ex.Message, ToastLength.Short).Show();
                }
            });
            alert.SetNegativeButton("Não", (senderAlert, args) =>
            {
            });

            RunOnUiThread(() =>
            {
                alert.Show();
            });
        }
Beispiel #3
0
 //Overrides back button settings
 public override void OnBackPressed()
 {
     //If results are showing, Go to opening page
     if (searchFragmentActivity != null)
     {
         //Home method executed
         Home();
     }
     //Exit app
     else
     { //Dialog Box Creation
         string TITLE = "Exit App?", MESSAGE = "Are you sure you want to leave?";
         Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);
         alert.SetTitle(TITLE);
         alert.SetMessage(MESSAGE);
         alert.SetPositiveButton("Yes", (senderAlert, args) =>
         {
             Finish();
             Toast.MakeText(this, "Don't forget to rate this app if you haven't already", ToastLength.Short).Show(); alert.Dispose();
         });
         alert.SetNegativeButton("No", (senderAlert, args) => { alert.Dispose(); });
         Dialog dialog = alert.Create();
         dialog.Show();
     }
 }
Beispiel #4
0
        public override void OnBackPressed()
        {
            try
            {
                Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(new ContextThemeWrapper(this, Resource.Style.AlertDialogCustom));
                alert.SetTitle("");
                alert.SetMessage("Are you sure you want to Exit?");

                alert.SetPositiveButton("YES", (senderAlert, args) =>
                {
                    Finish();
                });
                alert.SetNegativeButton("NO", (senderAlert, args) =>
                {
                });

                Dialog dialog = alert.Create();
                dialog.SetCanceledOnTouchOutside(false);
                dialog.Show();
            }
            catch (System.Exception ex)
            {
                Helper.ShowToastMessage(this, Color.DarkRed, ex.Message, ToastLength.Short);
            }
        }
Beispiel #5
0
        /// <summary>
        /// Sends an alert which displays the clients phone number
        /// and provides a call button which launches the phone app if the device is able to make calls.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void ButtonCallRide(object sender, EventArgs e)
        {
            if (KCApi.Properties.State != KCProperties.AppState.Map)
            {
                return;
            }

            ButtonDisable();
            //DisplayAlert(KCApi.Properties.CurrentRide.ClientName + "'s Phone Number is:", KCApi.Properties.CurrentRide.PhoneNum, "OK");

            var alertDialog = new Android.App.AlertDialog.Builder(CrossCurrentActivity.Current.Activity);

            alertDialog.SetTitle(KCApi.Properties.CurrentRide.ClientName + "'s Phone Number");
            alertDialog.SetMessage("(" + KCApi.Properties.CurrentRide.PhoneNum.Substring(0, 3) + ") "
                                   + KCApi.Properties.CurrentRide.PhoneNum.Substring(3, 3) + "-" + KCApi.Properties.CurrentRide.PhoneNum.Substring(6));
            alertDialog.SetPositiveButton("Call", (senderad, args) =>
            {
                Device.OpenUri(new Uri("tel:" + KCApi.Properties.CurrentRide.PhoneNum));
            });
            alertDialog.SetNegativeButton("Cancel", (senderad, args) =>
            {
                //Does not want to call
            });
            alertDialog.Create().Show();

            ButtonEnable();
        }
Beispiel #6
0
        void call_premium_option_menu(bool showRestricion = false)
        {
            Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this);
            //builder.SetTitle(TranslationHelper.GetString("moreAboutPremium", ci));
            builder.SetNegativeButton(TranslationHelper.GetString("cancel", _ci), (object sender1, DialogClickEventArgs e1) => { });
            if (!_databaseMethods.UserExists())
            {
                //constraintItems = new string[] { "Подробнее о Premium", "Войти в учетную запись" };
                builder.SetPositiveButton(TranslationHelper.GetString("login", _ci), (object sender1, DialogClickEventArgs e1) =>
                {
                    StartActivity(typeof(EmailActivity));
                });
                builder.SetNeutralButton(TranslationHelper.GetString("premium", _ci), (object sender1, DialogClickEventArgs e1) =>
                {
                    StartActivity(typeof(PremiumActivity));
                });
            }

            if (showRestricion)
            {
                builder.SetMessage(TranslationHelper.GetString("workOnSeveralDevicesRestricted", _ci));
            }
            else
            {
                builder.SetMessage(TranslationHelper.GetString("cardsLimitHasBeenReached", _ci));
            }
            Android.App.AlertDialog dialog = builder.Create();
            dialog.Show();
        }
        public void saveBtnClickEvent(object sender, EventArgs e)
        {
            alert.SetTitle("Error");
            if (userName.Text.Trim().Equals("") || userName.Text.Length < 0 || userAge.Text.Trim().Equals("") || userAge.Text.Length < 0 || userEmail.Text.Trim().Equals("") || userEmail.Text.Length < 0 || userPassword.Text.Trim().Equals("") || userPassword.Text.Length < 0)
            {
                alert.SetMessage("Enter right values in all fields.");
                alert.SetPositiveButton("OK", alertOKButton);
                alert.SetNegativeButton("Cancel", alertOKButton);
                Dialog myDialog = alert.Create();
                myDialog.Show();
            }

            /*else if (userCPassword.Text.Trim() != userCPassword.Text.Trim())
             * {
             *  alert.SetMessage("Passwords doesn't match");
             *  alert.SetPositiveButton("OK", alertOKButton);
             *  alert.SetNegativeButton("Cancel", alertOKButton);
             *  Dialog myDialog = alert.Create();
             *  myDialog.Show();
             * }*/
            else
            {
                myDB.updateData(name, email, password, age);
                alert.SetTitle("Info");
                alert.SetMessage("User details updated successfully!");
                alert.SetPositiveButton("OK", alertSuccessOKButton);
                Dialog myDialog = alert.Create();
                myDialog.Show();
            }
        }
Beispiel #8
0
        public void delListItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            Spinner delSpinner = FindViewById <Spinner>(Resource.Id.del_spinner);

            string dbPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "AdvMealdb.db3");
            var    dbM    = new SQLiteConnection(dbPath);

            dbM.CreateTable <AdvanceMeal>();
            var table = dbM.Table <AdvanceMeal>();

            string food = delAdvList[e.Position].Food;

            Android.App.AlertDialog.Builder message = new Android.App.AlertDialog.Builder(this);

            message.SetTitle("Delete it?");
            message.SetMessage("Are you sure to delete " + food + " from you meal list?");
            message.SetPositiveButton("YES", (c, ev) =>
            {
                var data_Del = table.Where(x => x.Food == food).FirstOrDefault();
                dbM.Delete(data_Del);

                refreshList(delSpinner.SelectedItem.ToString());
            });
            message.SetNegativeButton("NO", (c, ev) =>
            {
                refreshList(delSpinner.SelectedItem.ToString());
            });
            message.Show();
        }
Beispiel #9
0
        private void PrintAgain()
        {
            var alertDialog = new Android.App.AlertDialog.Builder(this);

            alertDialog.SetTitle("Additional Print");
            alertDialog.SetMessage("Do you want to print agin ?");
            alertDialog.SetCancelable(false);
            alertDialog.SetPositiveButton("Yes", (ss, se) =>
            {
                PrintFromPrinter();
            });
            alertDialog.SetNegativeButton("No", (ss, ee) =>
            {
                if (listType.Equals("UploadItemDetails"))
                {
                    var intent = new Intent(this, typeof(VehicleDetailActivity));
                    intent.AddFlags(ActivityFlags.ClearTop);
                    StartActivity(intent);
                    Finish();
                }
                else
                {
                    var intent = new Intent(this, typeof(DeliveryActivity));
                    intent.AddFlags(ActivityFlags.ClearTop);
                    StartActivity(intent);
                    Finish();
                }
            });
            alertDialog.Show();
        }
            private void InitUIComponents(View rootView)
            {
                mListView            = rootView.FindViewById(Resource.Id.list) as ListView;
                mListView.Adapter    = mAdapter;
                mListView.ItemClick += (sender, e) => {
                    MessagingChannel messagingChannel = mAdapter[e.Position];
                    if (OnMessagingChannelSelected != null)
                    {
                        OnMessagingChannelSelected(this, new MessagingChannelEventArgs(messagingChannel));
                    }
                };
                mListView.ItemLongClick += (sender, e) => {
                    MessagingChannel messagingChannel = mAdapter[e.Position];
                    var builder = new Android.App.AlertDialog.Builder(this.Activity);
                    builder.SetTitle("Leave");
                    builder.SetMessage("Do you want to leave this channel?");
                    builder.SetPositiveButton("Leave", (sender_child, e_child) => {
                        mAdapter.Remove(e.Position);
                        mAdapter.NotifyDataSetChanged();
                        SendBirdSDK.EndMessaging(messagingChannel.GetUrl());
                    });
                    builder.SetNeutralButton("Hide", (sender_child, e_child) => {
                        mAdapter.Remove(e.Position);
                        mAdapter.NotifyDataSetChanged();
                        SendBirdSDK.HideMessaging(messagingChannel.GetUrl());
                    });
                    builder.SetNegativeButton("Cancel", (EventHandler <DialogClickEventArgs>)null);

                    var dialog = builder.Create();
                    dialog.Show();
                };
            }
        void ShowDeleteConfirmationAlert()
        {
            // as long as this activity is not yet destroyed, show an alert for confirming the delete action
            if (!IsDestroyed)
            {
                //set alert for executing the task
                var alert = new Android.App.AlertDialog.Builder(this);

                alert.SetTitle("Delete?");

                alert.SetMessage($"Are you sure you want to delete {_Acquaintance.FirstName} {_Acquaintance.LastName}?");

                alert.SetPositiveButton("Delete", async(senderAlert, args) => {
                    await _DataSource.RemoveItem(_Acquaintance);
                    OnBackPressed();
                });

                alert.SetNegativeButton("Cancel", (senderAlert, args) => {
                    // an empty delegate body, because we just want to close the dialog and not take any other action
                });

                //run the alert in UI thread to display in the screen
                RunOnUiThread(() => {
                    alert.Show();
                });
            }
        }
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            if (item.ItemId == Android.Resource.Id.Home)
            {
                Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);

                alert.SetTitle("Do you want to leave?");

                alert.SetPositiveButton("Yes", (senderAlert, args) =>
                {
                    Finish();
                });

                alert.SetNegativeButton("No", (senderAlert, args) => {
                });

                RunOnUiThread(() => {
                    alert.Show();
                });
            }
            else if (item.ItemId == Resource.Id.done)
            {
                ButtonAddClicked();
                return(true);
            }

            return(base.OnOptionsItemSelected(item));
        }
        protected void ShowExitDialog()
        {
            Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);
            alert.SetTitle("Exit");
            alert.SetMessage("Stop tracking and close application?");
            alert.SetPositiveButton("Yes", (senderAlert, args) =>
            {
                try
                {
                    if (AppWrapper.ServiceIntent != null)
                    {
                        StopService(AppWrapper.ServiceIntent);
                    }

                    AppWrapper.ServiceIntent = null;

                    System.Environment.Exit(0);
                }
                catch (Exception ex)
                {
                    Toast.MakeText(this, "Exit operation error: " + ex.ToString(), ToastLength.Short).Show();
                }
            });
            alert.SetNegativeButton("Cancel", (senderAlert, args) =>
            {
            });

            Android.App.Dialog dialog = alert.Create();
            dialog.Show();
        }
Beispiel #14
0
        private void CallUs(string p1, string p2)
        {
            string[] nos = new string[]
            {
                p1,
                p2
            };
            var phone   = "";
            var builder = new Android.App.AlertDialog.Builder(this);

            builder.SetTitle(Resource.String.menu_contact_us);
            builder.SetSingleChoiceItems(nos, 0, delegate(object sender, DialogClickEventArgs e)
            {
                phone = nos[e.Which];
            });
            builder.SetPositiveButton(Resource.String.btn_call, delegate
            {
                builder.Dispose();
                if (!string.IsNullOrEmpty(phone))
                {
                    phone = nos[0];
                }
                Intent _phone = new Intent(Intent.ActionCall,
                                           Android.Net.Uri.Parse(string.Format("tel:{0}", phone)));
                StartActivity(_phone);
            });
            builder.SetNegativeButton(Resource.String.dialog_cancel, delegate
                                      { builder.Dispose(); });
            builder.Show();
        }
        //Реагуємо на кліки по Action Bar та висувного списку
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Android.Resource.Id.Home:
                mDrawerLayout.OpenDrawer((int)GravityFlags.Left);

                mNavigationView.Menu.FindItem(Resource.Id.nav_management).SetCheckable(true);
                mNavigationView.Menu.FindItem(Resource.Id.nav_management).SetChecked(true);

                return(true);

            case Resource.Id.create_cleaning_task:
                IntentManagement.IntentManagement.CreateIntentToUpdateCleaningTask(this, -1, roomId);
                return(true);

            case Resource.Id.delete_room:
                Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this);

                builder.SetMessage(Resource.String.delete_alert_dialog_message);
                builder.SetPositiveButton(Resource.String.positive_button_lined_text_dialog, DeleteAlertDialogPositiveButtonListener);
                builder.SetNegativeButton(Resource.String.negative_button_lined_text_dialog, DeleteAlertDialogNegativeButtonListener);
                builder.Create();

                builder.Show();
                return(true);

            default:
                return(base.OnOptionsItemSelected(item));
            }
        }
Beispiel #16
0
        private void MakeACall(string p, string p2)
        {
            string[] nos = new string[]
            {
                p,
                p2
            };
            var phone   = "";
            var builder = new Android.App.AlertDialog.Builder(this);

            builder.SetTitle("Wasiliana nasi");
            builder.SetSingleChoiceItems(nos, 0, delegate(object sender, DialogClickEventArgs e)
            {
                phone = nos[e.Which];
            });
            builder.SetPositiveButton("Piga", delegate
            {
                builder.Dispose();
                if (!string.IsNullOrEmpty(phone))
                {
                    phone = nos[0];
                }
                Intent _phone = new Intent(Intent.ActionCall,
                                           Android.Net.Uri.Parse(string.Format("tel:{0}", phone)));
                StartActivity(_phone);
            });
            builder.SetNegativeButton("Tengua", delegate
                                      { builder.Dispose(); });
            builder.Show();
        }
        void myButtonClick(object sender, System.EventArgs e)
        {
            if (login.Text == "" || password.Text == "" || login.Equals("") || password.Equals(""))
            {
                myAlert.SetTitle("Validation Error");
                myAlert.SetMessage("Please Enter Your User Name or Password");
                myAlert.SetPositiveButton("OK", OkAction);
                myAlert.SetNegativeButton("Cancel", CancelAction);
                Dialog myDialog = myAlert.Create();
                myDialog.Show();
            }
            else
            {
                bool dbValidation = myDbInstance.checkUser(login.Text, password.Text);
                if (dbValidation)
                {
                    CrossSecureStorage.Current.SetValue("userIdAuth", "" + myDbInstance.getUserId(login.Text) + "");
                    Intent welcome = new Intent(this, typeof(TabLib));//PokeballPage will be
                    welcome.PutExtra("username", login.Text);
                    welcome.PutExtra("password", password.Text);

                    StartActivity(welcome);
                }
                else
                {
                    myAlert.SetTitle("User or Password is incorrect");
                    myAlert.SetMessage("Try again!");
                    myAlert.SetPositiveButton("OK", OkAction);
                    Dialog myDialog = myAlert.Create();
                    myDialog.Show();
                }
            }
        }
Beispiel #18
0
        private void MyListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            myAlert = new Android.App.AlertDialog.Builder(Activity);
            var index = e.Position;

            myAlert.SetTitle("Delete");
            myAlert.SetMessage("Do you want to delete this user?");

            myAlert.SetNegativeButton("Delete", delegate {
                var data = myUserList[e.Position];
                myDbInstance.deleteVehicleValue(idU, data.cId.ToString());
                refreshData();
            });

            myAlert.SetPositiveButton("Edit", delegate {
                var data = myUserList[e.Position];
                i        = new Intent(Activity, typeof(EditAdd));
                i.PutExtra("cid", data.cId.ToString());
                i.PutExtra("uid", idU);
                StartActivity(i);
            });
            Dialog myDialog = myAlert.Create();

            myDialog.Show();
            //    var myValue = stringArray[index];
        }
Beispiel #19
0
        private void Toolbar_MenuItemClick(object sender, Android.Support.V7.Widget.Toolbar.MenuItemClickEventArgs e)
        {
            Android.App.AlertDialog.Builder lObjDialog = new Android.App.AlertDialog.Builder(this);
            lObjDialog.SetTitle("ICC");
            switch (e.Item.ItemId)
            {
            case Resource.Id.cambiar_share_general:
                lObjDialog.SetMessage("¿Esta seguro que desea cambiar de usuario?");
                break;

            case Resource.Id.salir_share_general:
                lObjDialog.SetMessage("¿Esta seguro que desea salir del sistema?");
                break;
            }
            lObjDialog.SetPositiveButton("Si", delegate
            {
                switch (e.Item.ItemId)
                {
                case Resource.Id.cambiar_share_general:
                    IccSql lObjSql = new IccSql();
                    lObjSql.EliminarInicioAutomatico();
                    Intent lObjIntent = new Intent(this, typeof(InicioActivity));
                    StartActivity(lObjIntent);
                    break;

                case Resource.Id.salir_share_general:
                    FinishAffinity();
                    break;
                }
            });
            lObjDialog.SetNegativeButton("No", delegate {
                return;
            });
            lObjDialog.Show();
        }
        public override void OnBackPressed()
        {
            // Confirm if the user wants to logout
            var dialogEditor = new Android.App.AlertDialog.Builder(this);

            dialogEditor.SetTitle("Logout");
            dialogEditor.SetNegativeButton("Yes", (x, y) =>
            {
                // we do nothing as we don't care?
                Token.AuthToken = "";

                ISharedPreferences prefs        = PreferenceManager.GetDefaultSharedPreferences(this);
                ISharedPreferencesEditor editor = prefs.Edit();
                editor.PutString("AuthToken", null);
                editor.Apply();

                var loginIntent = new Intent(this, typeof(LoginActvitiy));
                StartActivity(loginIntent);
                Finish();
            });

            dialogEditor.SetPositiveButton("No", (x, y) =>
            {
                // Cancel
            });
            dialogEditor.Show();
        }
Beispiel #21
0
        private void OnBtnDeletedClicked(int position)
        {
            Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(m_context);
            alert.SetTitle(m_Parent.Resources.GetString(Resource.String.recyclerviewAdapter_display_trajets_deleteConfirmationTitle));
            alert.SetMessage(m_Parent.Resources.GetString(Resource.String.recyclerviewAdapter_display_trajets_deleteConfirmationContent));
            alert.SetPositiveButton(m_Parent.Resources.GetString(Resource.String.recyclerviewAdapter_display_trajets_deleteConfirmationOK), async(senderAlert, args) =>
            {
                if (TryDeletetrajet(position))
                {
                    MobileCenter_Helper.TrackEvent(new FileAccessManager(), GetType().Name, MethodBase.GetCurrentMethod().Name + ", position=" + position + ", trajetClicked = " + m_lstrajet?[position]?.m_sRefNumber ?? "null");
                    await((Fragment_Listtrajets)m_Parent).RefreshtrajetList();
                }
                else
                {
                    DynamicUIBuild_Utils.ShowSnackBar_WithOKButtonToClose(m_context, m_Parent.View, Resource.String.recyclerviewAdapter_display_trajets_deleteError);
                }
            });

            alert.SetNegativeButton(m_Parent.Resources.GetString(Resource.String.recyclerviewAdapter_display_trajets_deleteConfirmationCancel), (senderAlert, args) =>
            {
                //On ne fait rien
            });

            Dialog dialog = alert.Create();

            dialog.Show();
        }
Beispiel #22
0
        public bool CheckConnection()
        {
            ConnectivityManager connectivityManager = (ConnectivityManager)GetSystemService(ConnectivityService);
            NetworkInfo         info = connectivityManager.ActiveNetworkInfo;

            if (info != null && info.IsConnected)
            {
                return(true);
            }
            else
            {
                var    dialog  = new Android.App.AlertDialog.Builder(this);
                string message = "Для работы приложения необходимо интернет-соединение";
                string title   = "Нет интернет соединения";
                dialog.SetTitle(title);
                dialog.SetMessage(message);

                dialog.SetCancelable(false);
                dialog.SetMessage(message);
                dialog.SetPositiveButton("Повторить", delegate { this.Recreate(); });
                dialog.SetNegativeButton("Выйти", delegate { this.Finish(); });
                dialog.Show();
                return(false);
            }
        }
Beispiel #23
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            expandableListView = FindViewById <ExpandableListView>(Resource.Id.expandableListView);
            expandableListView.SetAdapter(mAdapter);

            //Set Data
            try
            {
                SetData(out mAdapter);
            }
            catch (System.Exception)
            {
                Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);
                alert.SetTitle("Message d'erreur");
                alert.SetMessage("Vérifiez votre connexion internet");
                alert.SetPositiveButton("Quitter", (senderAlert, args) =>
                {
                    Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
                });
                alert.SetNegativeButton("OK", (senderAlert, args) =>
                {
                    Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
                });
                Dialog dialog = alert.Create();
                dialog.Show();
            }
            expandableListView.SetAdapter(mAdapter);
        }
Beispiel #24
0
        async Task GetPermissionsAsync()
        {
            const string permission = Manifest.Permission.AccessFineLocation;

            if (CheckSelfPermission(permission) == (int)Android.Content.PM.Permission.Granted)
            {
                //TODO change the message to show the permissions name
                return;
            }
            if (ShouldShowRequestPermissionRationale(permission))
            {
                //set alert for executing the task
                Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);
                alert.SetTitle("Permissions Needed");
                alert.SetMessage("The application need SMS permissions to continue");
                alert.SetPositiveButton("Request Permissions", (senderAlert, args) =>
                {
                    RequestPermissions(PermissionsGroupLocation, RequestLocationId);
                });
                alert.SetNegativeButton("Cancel", (senderAlert, args) =>
                {
                    Toast.MakeText(this, "Cancelled!", ToastLength.Short).Show();
                });
                Dialog dialog = alert.Create();
                dialog.Show();
                return;
            }
            RequestPermissions(PermissionsGroupLocation, RequestLocationId);
        }
Beispiel #25
0
        async Task LoadAcquaintances()
        {
            _SwipeRefreshLayout.Refreshing = true;

            try
            {
                // load the items
                await _Adapter.LoadAcquaintances();
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine($"Error getting acquaintances: {ex.Message}");

                //set alert for executing the task
                var alert = new Android.App.AlertDialog.Builder(this);

                alert.SetTitle("Error getting acquaintances");

                alert.SetMessage("Ensure you have a network connection, and that a valid backend service URL is present in the app settings.");

                alert.SetNegativeButton("OK", (senderAlert, args) => {
                    // an empty delegate body, because we just want to close the dialog and not take any other action
                });

                //run the alert in UI thread to display in the screen
                RunOnUiThread(() => {
                    alert.Show();
                });
            }
            finally
            {
                _SwipeRefreshLayout.Refreshing = false;
            }
        }
        private void LinkEventHandlers()
        {
            _editOutsideActivityNameEditText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                outsideActivity.Name = e.Text.ToString();
            };
            /// FIGURE OUT HOW TO POPULATE NOTES FIELD AND DISPLAY THE NOTES.
            _editOutsideActivityNotesEditText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                outsideActivity.Notes = e.Text.ToString();
            };

            _editOutsideActivityStartDateEditText.Click += _editOutsideActivityStartDateEditText_Click;
            _editOutsideActivityStartTimeEditText.Click += _editOutsideActivityStartTimeEditText_Click;
            _updateOutsideActivityButton.Click          += _updateOutsideActivityButton_Click;
            // popup dialog to confirm activity should be deleted
            _deleteOutsideActivityButton.Click += delegate {
                Android.App.AlertDialog.Builder alertDiag = new Android.App.AlertDialog.Builder(this);
                alertDiag.SetTitle("Confirm delete");
                alertDiag.SetMessage("Once deleted the activity cannot be recovered");
                alertDiag.SetPositiveButton("Delete", (senderAlert, args) => {
                    _dataService.DeleteOutsideActivity(outsideActivity);

                    Toast.MakeText(this, "Deleted", ToastLength.Short).Show();
                    Finish();
                });
                alertDiag.SetNegativeButton("Cancel", (senderAlert, args) => {
                    alertDiag.Dispose();
                });
                Dialog diag = alertDiag.Create();
                diag.Show();
            };
        }
        private void SortingDialog()
        {
            var builder = new Android.App.AlertDialog.Builder(this);

            builder.SetTitle(Resource.String.dlg_title_sorting);
            builder.SetSingleChoiceItems(Resource.Array.sorting_price, filters, delegate(object s, DialogClickEventArgs e)
            {
                filters = e.Which;
            });
            builder.SetPositiveButton(Resource.String.dialog_ok, delegate
            {
                builder.Dispose();
                if (filters == 0)
                {
                    //Sort by high price
                    sortByAsc = false;
                    SortListed(sortByAsc);
                }
                else
                {
                    //Sort by lower price
                    sortByAsc = true;
                    SortListed(sortByAsc);
                }
            });
            builder.SetNegativeButton(Resource.String.dialog_cancel, delegate
                                      { builder.Dispose(); });
            builder.Show();
        }
        void myButtonClick(object sender, System.EventArgs e)
        {
            myAlert.SetTitle("Validation Error");
            myAlert.SetMessage("Please Fill All Fields!");
            myAlert.SetPositiveButton("OK", OkAction);


            bool validation = (firstName.Text == "" || email.Text == "" || password.Text == "" || firstName.Equals("") || email.Equals("") || password.Equals("")) ? true : false;


            if (validation)
            {
                myAlert.SetNegativeButton("Cancel", CancelAction);
                Dialog myDialog = myAlert.Create();
                myDialog.Show();
            }
            else
            {
                myDbInstance.insertNewUser(random.Next(), firstName.Text, email.Text, username.Text, password.Text);
                myAlert.SetTitle("You have created new account successfully!!");
                myAlert.SetMessage("Proceed to login page");
                myAlert.SetPositiveButton("OK", OkActionDone);

                Dialog myDialog = myAlert.Create();
                myDialog.Show();
            }
        }
Beispiel #29
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            var alertDialog = new Android.App.AlertDialog.Builder(this);

            alertDialog.SetTitle("Save");
            alertDialog.SetMessage("Do you want to save ?");
            alertDialog.SetCancelable(false);
            alertDialog.SetPositiveButton("Yes", (ss, se) =>
            {
                if (listType.Equals("UploadItemDetails"))
                {
                    var intent = new Intent(this, typeof(VehicleDetailActivity));
                    intent.AddFlags(ActivityFlags.ClearTop);
                    StartActivity(intent);
                    Finish();
                }
                else
                {
                    var intent = new Intent(this, typeof(DeliveryActivity));
                    intent.AddFlags(ActivityFlags.ClearTop);
                    StartActivity(intent);
                    Finish();
                }
            });
            alertDialog.SetNegativeButton("No", (ss, ee) => { });
            alertDialog.Show();
        }
        public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
        {
            base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
            Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
            if (grantResults.Length > 0 && grantResults[0] != Android.Content.PM.Permission.Granted)
            {
                Android.App.AlertDialog.Builder dlgAlert = new Android.App.AlertDialog.Builder(this);
                dlgAlert.SetMessage("You must give Beat On write access to your external storage or it cannot function.");
                dlgAlert.SetTitle("Beat On Permissions");
                dlgAlert.SetPositiveButton("Try Again", (o, e) =>
                {
                    ActivityCompat.RequestPermissions(this, new String[] { Android.Manifest.Permission.WriteExternalStorage }, 1);
                });
                dlgAlert.SetNegativeButton("Close", (o, e) =>
                {
                    Java.Lang.JavaSystem.Exit(0);
                });
                dlgAlert.SetCancelable(true);

                dlgAlert.Create().Show();
            }
            else
            {
                ContinueLoad();
            }
        }
Beispiel #31
0
 public override void OnBackPressed()
 {
     var builder = new Android.App.AlertDialog.Builder(this);
     builder.SetTitle ("Exit.");
     builder.SetIcon (Android.Resource.Drawable.IcDialogAlert);
     builder.SetMessage("Exit App?");
     builder.SetPositiveButton("OK", (s, e) =>
         {
             System.Environment.Exit(0);
         });
     builder.SetNegativeButton("Cancel", (s, e) => { });
     builder.Create().Show();
 }
 public void btnCloseA_OnClick(object sender, EventArgs EventArgs)
 {
     var builder = new Android.App.AlertDialog.Builder(this);
     builder.SetTitle ("Exit.");
     builder.SetIcon (Android.Resource.Drawable.IcDialogAlert);
     builder.SetMessage("Exit App?");
     builder.SetPositiveButton("OK", (s, e) =>
         {
             Finish();
             Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
             //System.Environment.Exit(0);
         });
     builder.SetNegativeButton("Cancel", (s, e) => { });
     builder.Create().Show();
 }
Beispiel #33
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View v = inflater.Inflate(Resource.Layout.fragment_crime, container, false);

            if (Build.VERSION.SdkInt >= BuildVersionCodes.Honeycomb) {
                // Using ParentActivity and NavUtils causes OnCreate to be called again
                // in CrimeListFragment, causing the subtitle view to be reset
            //				if (NavUtils.GetParentActivityName(Activity) != null) {
                    Activity.ActionBar.SetDisplayHomeAsUpEnabled(true);
            //				}
            }

            mTitleField = (EditText)v.FindViewById(Resource.Id.crime_title_edittext);
            mTitleField.SetText(mCrime.Title, TextView.BufferType.Normal);
            mTitleField.BeforeTextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                // nothing for now
            };
            mTitleField.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                mCrime.Title = e.Text.ToString();
                mCallBacks.OnCrimeUpdated();
            };
            mTitleField.AfterTextChanged += (object sender, Android.Text.AfterTextChangedEventArgs e) => {
                // nothing for now
            };

            // One DateTime Button
            mDateButton = (Button)v.FindViewById(Resource.Id.crime_date_button);
            mDateButton.Click += (sender, e) => {
                Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(Activity);
                builder.SetTitle(Resource.String.date_or_time_alert_title);
                builder.SetPositiveButton(Resource.String.date_or_time_alert_date, (object date, DialogClickEventArgs de) => {
                    Android.Support.V4.App.FragmentManager fm = Activity.SupportFragmentManager;
                    DatePickerFragment dialog = DatePickerFragment.NewInstance(mCrime.Date);
                    dialog.SetTargetFragment(this, REQUEST_DATE);
                    dialog.Show(fm, CrimeFragment.DIALOG_DATE);
                });
                builder.SetNegativeButton(Resource.String.date_or_time_alert_time, (object time, DialogClickEventArgs de) => {
                    Android.Support.V4.App.FragmentManager fm = Activity.SupportFragmentManager;
                    TimePickerFragment dialog = TimePickerFragment.NewInstance(mCrime.Date);
                    dialog.SetTargetFragment(this, REQUEST_TIME);
                    dialog.Show(fm, CrimeFragment.DIALOG_TIME);
                });
                builder.Show();

            };

            // Separate date and time buttons
            //			mDateButton = (Button)v.FindViewById(Resource.Id.crime_date_button);
            //			mDateButton.Click += (sender, e) => {
            //				FragmentManager fm = Activity.SupportFragmentManager;
            //				DatePickerFragment dialog = DatePickerFragment.NewInstance(mCrime.Date);
            //				dialog.SetTargetFragment(this, REQUEST_DATE);
            //				dialog.Show(fm, CrimeFragment.DIALOG_DATE);
            //			};
            //
            //			mTimeButton = (Button)v.FindViewById(Resource.Id.crime_time_button);
            //			mTimeButton.Click += (sender, e) => {
            //				FragmentManager fm = Activity.SupportFragmentManager;
            //				TimePickerFragment dialog = TimePickerFragment.NewInstance(mCrime.Date);
            //				dialog.SetTargetFragment(this, REQUEST_TIME);
            //				dialog.Show(fm, CrimeFragment.DIALOG_TIME);
            //			};

            UpdateDateTime();

            mSolvedCheckBox = (CheckBox)v.FindViewById(Resource.Id.crime_solved_checkbox);
            mSolvedCheckBox.Checked = mCrime.Solved;
            mSolvedCheckBox.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => {
                mCrime.Solved = e.IsChecked;
                mCallBacks.OnCrimeUpdated();
            };

            mPhotoView = v.FindViewById<ImageView>(Resource.Id.crime_imageView);
            mPhotoView.Click += (object sender, EventArgs e) => {
                Photo p = mCrime.Photo;
                if (p == null)
                    return;
                Android.Support.V4.App.FragmentManager fm = Activity.SupportFragmentManager;

                // BNR
            //				string path = Activity.GetFileStreamPath(p.Filename).AbsolutePath;
                if (p.Filename != null)
                    ImageFragment.NewInstance(p.Filename, p.GetRotation()).Show(fm, DIALOG_IMAGE);
            };
            mPhotoView.LongClick += (object sender, View.LongClickEventArgs e) => {
                if (mCrime.Photo != null) {
                    AlertDialog.Builder ad = new AlertDialog.Builder(Activity);
                    ad.SetTitle(mCrime.Title);
                    ad.SetMessage("Do you really want to delete the photo evidence of this crime?");
                    ad.SetCancelable(true);
                    ad.SetPositiveButton("DELETE", delegate(object s, DialogClickEventArgs evt) {
                        if (File.Exists(mCrime.Photo.Filename)) {
                            File.Delete(mCrime.Photo.Filename);
                            mCrime.Photo = null;
                            mPhotoView.SetImageDrawable(null);
                        }
                    });
                    ad.SetNegativeButton("Cancel", (s, evt) => {});
                    ad.Show();
                }
            };

            // From Xamarin guide
            mPhotoButton = v.FindViewById<ImageButton>(Resource.Id.crime_imageButton);
            if (IsAppToTakePicture()) {

                CreateDirectoryForPictures();

                mPhotoButton.Click += (object sender, EventArgs e) => {
                    // From xamarin guide
                    Intent intent = new Intent(MediaStore.ActionImageCapture);

                    PhotoApp._file = new Java.IO.File(PhotoApp._dir, String.Format("{0}.jpg", Guid.NewGuid()));

                    intent.PutExtra(MediaStore.ExtraOutput, Android.Net.Uri.FromFile(PhotoApp._file));

                    StartActivityForResult(intent, REQUEST_PHOTO);

                    // From BNR Book - trying Xamarin method above
            //					Intent i = new Intent(Activity, typeof(CrimeCameraActivity));
            //					StartActivityForResult(i, REQUEST_PHOTO);
                };
            }
            else {
                mPhotoButton.Enabled = false;
            }
            // If camera is not available, disable button - checked in the if statement above
            // just shows another method
            //			PackageManager pm = Activity.PackageManager;
            //			if (!pm.HasSystemFeature(PackageManager.FeatureCamera) && !pm.HasSystemFeature(PackageManager.FeatureCameraFront)) {
            //				mPhotoButton.Enabled = false;
            //			}

            Button reportButton = v.FindViewById<Button>(Resource.Id.crime_reportButton);
            reportButton.Click += (object sender, EventArgs e) => {
                Intent i = new Intent(Intent.ActionSend);
                i.SetType("text/plain");
                i.PutExtra(Intent.ExtraText, GetCrimeReport());
                i.PutExtra(Intent.ExtraSubject, GetString(Resource.String.crime_report_subject));
                i = Intent.CreateChooser(i, GetString(Resource.String.send_report));
                StartActivity(i);
            };

            mSuspectButton = v.FindViewById<Button>(Resource.Id.crime_suspectButton);
            mCallButton = v.FindViewById<Button>(Resource.Id.crime_callButton);

            mSuspectButton.Click += (object sender, EventArgs e) => {
                Intent i = new Intent(Intent.ActionPick, ContactsContract.Contacts.ContentUri);
                StartActivityForResult(i, REQUEST_CONTACT);
            };

            if (mCrime.Suspect != null) {
                mSuspectButton.Text = GetString(Resource.String.crime_report_suspect, mCrime.Suspect);
            }

            if (mCrime.PhoneNumber != null) {
                mCallButton.Text = GetString(Resource.String.crime_report_call) + " " + mCrime.PhoneNumber;
                mCallButton.Enabled = true;
            }
            else {
                mCallButton.Enabled = false;
            }

            mCallButton.Click += (object sender, EventArgs e) => {
                Intent i = new Intent(Intent.ActionDial, Android.Net.Uri.Parse("tel:" + mCrime.PhoneNumber));//.Replace("(","").Replace(")","").Replace("-","")));
                StartActivity(i);
            };

            return v;
        }
        public override void DisplayMessage(MessageDisplayParams messageParams)
        {
            Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this.context);
            builder.SetTitle(messageParams.Title);
            builder.SetMessage(messageParams.Message);

            if (messageParams.PositiveAction != null)
            {
                builder.SetPositiveButton(messageParams.PositiveLabel ?? DefaultPositiveLabel, (s, e) =>
                    {
                        messageParams.PositiveAction();
                    });
            }

            if (messageParams.NegativeAction != null)
            {
                builder.SetNegativeButton(messageParams.NegativeLabel ?? DefaultNegativeLabel, (s, e) =>
                    {
                        messageParams.NegativeAction();
                    });
            }

            if (messageParams.NeutralAction != null)
            {
                builder.SetNeutralButton(messageParams.NeutralLabel ?? string.Empty, (s, e) =>
                    {
                        messageParams.NeutralAction();
                    });
            }

            var dialog = builder.Create();
            dialog.DismissEvent += (sender, e) => {
                this.messages.Remove(messageParams);
            };

            this.messages.Add(messageParams);
            this.dialogs.Add(dialog);

            dialog.Show();
        }
 public override void OnBackPressed()
 {
     var builder = new Android.App.AlertDialog.Builder(this);
     builder.SetTitle ("Exit.");
     builder.SetIcon (Android.Resource.Drawable.IcDialogAlert);
     builder.SetMessage("Exit App?");
     builder.SetPositiveButton("OK", (s, e) =>
         {
             mSharedPreferences = this.GetSharedPreferences ("CheckInPrefs", FileCreationMode.Private);
             ISharedPreferencesEditor editor = mSharedPreferences.Edit ();
             editor.Remove ("SessionKey");
             editor.Commit ();
             if (!(geofenceRequestIntent == null)) {
                 geofenceRequestIntent.Cancel ();
             }
             Finish();
             Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
             //System.Environment.Exit(0);
         });
     builder.SetNegativeButton("Cancel", (s, e) => { });
     builder.Create().Show();
 }
Beispiel #36
0
 public BluetoothPrinter(Android.App.Activity activity, PrinterType type, string Number)
 {
     this.as_Number = Number;
     this.printerType = type;
     this.activity = activity;
     //获得本地的蓝牙适配器
     localAdapter = Android.Bluetooth.BluetoothAdapter.DefaultAdapter;
     if (string.IsNullOrEmpty(Number))
     {
         Android.Widget.Toast.MakeText(activity, "传入的单号为空,打印失败", Android.Widget.ToastLength.Short).Show();
         return;
     }
     //打开蓝牙设备
     if (!localAdapter.IsEnabled)
     {
         Android.Content.Intent enableIntent = new Android.Content.Intent(Android.Bluetooth.BluetoothAdapter.ActionRequestEnable);
         activity.StartActivityForResult(enableIntent, 1);
     }
     //静默打开
     if (!localAdapter.IsEnabled)
     {
         localAdapter.Enable();
     }
     if (!localAdapter.IsEnabled)//用户拒绝打开或系统限制权限
     {
         Android.Widget.Toast.MakeText(activity, "蓝牙未打开", Android.Widget.ToastLength.Short).Show();
         return;
     }
     //获得已配对的设备列表
     bondedDevices = new List<Android.Bluetooth.BluetoothDevice>(localAdapter.BondedDevices);
     if (bondedDevices.Count <= 0)
     {
         Android.Widget.Toast.MakeText(activity, "未找到已配对的蓝牙设备", Android.Widget.ToastLength.Short).Show();
         return;
     }
     string[] items = new string[bondedDevices.Count];
     for (int i = 0; i < bondedDevices.Count; i++)
     {
         items[i] = bondedDevices[i].Name;
     }
     Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(activity);
     builder.SetTitle("请选择打印设备:");
     builder.SetItems(items, new System.EventHandler<Android.Content.DialogClickEventArgs>(items_click));
     builder.SetNegativeButton("取消", delegate { return; });
     builder.Show();
 }
Beispiel #37
0
 /// <summary>
 /// 打印测试
 /// </summary>
 /// <param name="activity"></param>
 public BluetoothPrinter(Android.App.Activity activity)
 {
     this.activity = activity;
     //获得本地的蓝牙适配器
     localAdapter = Android.Bluetooth.BluetoothAdapter.DefaultAdapter;
     //打开蓝牙设备
     if (!localAdapter.IsEnabled)
     {
         Android.Content.Intent enableIntent = new Android.Content.Intent(Android.Bluetooth.BluetoothAdapter.ActionRequestEnable);
         activity.StartActivityForResult(enableIntent, 1);
     }
     //静默打开
     if (!localAdapter.IsEnabled)
     {
         localAdapter.Enable();
     }
     if (!localAdapter.IsEnabled)//用户拒绝打开或系统限制权限
     {
         Android.Widget.Toast.MakeText(activity, "蓝牙未打开", Android.Widget.ToastLength.Short).Show();
         return;
     }
     //获得已配对的设备列表
     bondedDevices = new List<Android.Bluetooth.BluetoothDevice>(localAdapter.BondedDevices);
     if (bondedDevices.Count <= 0)
     {
         Android.Widget.Toast.MakeText(activity, "未找到已配对的蓝牙设备", Android.Widget.ToastLength.Short).Show();
         return;
     }
     string[] items = new string[bondedDevices.Count];
     //查看本地已设置的printer名称
     string ls_localPrinterName = baseclass.MyConfig.of_GetMySysSet("printer", "name");
     if (!string.IsNullOrEmpty(ls_localPrinterName))
     {
         for (int j = 0; j < bondedDevices.Count; j++)
         {
             if(ls_localPrinterName== bondedDevices[j].Name)
             {
                 as_BluetoothName = ls_localPrinterName;
                 System.Threading.Thread thr2 = new System.Threading.Thread(new System.Threading.ThreadStart(Printer));
                 thr2.Start(activity);
                 return;
             }
         }
     }
     //弹窗选择
     for (int i = 0; i < bondedDevices.Count; i++)
     {
         items[i] = bondedDevices[i].Name;
     }
     Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(activity);
     builder.SetTitle("请选择打印设备:");
     builder.SetItems(items, new System.EventHandler<Android.Content.DialogClickEventArgs>(items_click));
     builder.SetNegativeButton("取消", delegate { return; });
     builder.Show();
 }
		private void DeleteFolderOrFile (string path)
		{
			popupWindow.Dismiss ();

			var alertDialogConfirmDelete = new Android.App.AlertDialog.Builder (Activity);
			alertDialogConfirmDelete.SetTitle("Waarschuwing");
			alertDialogConfirmDelete.SetMessage("Bent u zeker van deze verwijder actie? \nDeze actie is niet terug te draaien.");

			alertDialogConfirmDelete.SetPositiveButton ("Verwijderen", async delegate { 
				try {
					parentActivity.ShowProgressDialog ("Verwijderen... Een ogenblik geduld a.u.b.");

					bool deleteSucceed = await DataLayer.Instance.DeleteFileOrFolder (path);

					parentActivity.HideProgressDialog ();

					if (!deleteSucceed) {
						Toast.MakeText (Android.App.Application.Context, "Verwijderen mislukt - druk op ververs en probeer het a.u.b. opnieuw", ToastLength.Long).Show ();
					} else {
						Toast.MakeText (Android.App.Application.Context, "Verwijderen succesvol", ToastLength.Short).Show ();

						//Refresh listview
						RefreshData ();
					}
				} catch (Exception ex){
					Insights.Report(ex);
					parentActivity.HideProgressDialog (); 
					Toast.MakeText (Android.App.Application.Context, "Verwijderen mislukt - druk op ververs en probeer het a.u.b. opnieuw", ToastLength.Long).Show ();
				}
			});
			alertDialogConfirmDelete.SetNegativeButton ("Annuleren", delegate { 
				alertDialogConfirmDelete.Dispose();
			});
			alertDialogConfirmDelete.Create ().Show ();
		}
		void ListView_OnItemLongClick (object sender, AdapterView.ItemLongClickEventArgs e)
		{
			LocalBox clickedItem = foundLocalBoxes [e.Position];

			LayoutInflater inflater = (LayoutInflater)Activity.GetSystemService (Context.LayoutInflaterService); 
			View popupView;
			popupView = inflater.Inflate (Resource.Layout.custom_popup_root, null);

			PopupWindow popupWindow = new PopupWindow (popupView, e.View.Width, e.View.Height);

			//Hide popup window when clicking outside its view
			popupWindow.Focusable = true;
			popupWindow.Update ();
			popupWindow.SetBackgroundDrawable(new BitmapDrawable());

			popupWindow.ShowAsDropDown (e.View, 0, - e.View.Height);

			ImageButton buttonDelete = (ImageButton) popupView.FindViewById(Resource.Id.button_popup_root_delete);

			buttonDelete.Click += delegate {
				popupWindow.Dismiss();

				var alertDialogConfirmDelete = new Android.App.AlertDialog.Builder (Activity);
				alertDialogConfirmDelete.SetTitle("Waarschuwing");
				alertDialogConfirmDelete.SetMessage("Weet u zeker dat u deze Pleiobox wilt verwijderen? \nDeze actie is niet terug te draaien.");

				alertDialogConfirmDelete.SetPositiveButton ("Verwijderen", async delegate { 
					try{
						DataLayer.Instance.DeleteLocalBox(clickedItem.Id);
						ResetUIToBeginState(true);
						UpdateLocalBoxes();

						List<LocalBox> registeredLocalBoxes = await DataLayer.Instance.GetLocalBoxes ();
						if (registeredLocalBoxes.Count == 0) {
							HomeActivity homeActivity = (HomeActivity)Activity;
							homeActivity.ShowLoginDialog();
						}
						//Reset logo
						//imageViewLogo.SetImageResource (Resource.Drawable.beeldmerk_belastingdienst);
					}catch (Exception ex){
						Insights.Report(ex);
						Toast.MakeText (Android.App.Application.Context, "Het verwijderen van de Pleiobox is mislukt", ToastLength.Short).Show ();
					}
				});
				alertDialogConfirmDelete.SetNegativeButton ("Annuleren", delegate { 
					alertDialogConfirmDelete.Dispose();
				});
				alertDialogConfirmDelete.Create ().Show ();
			};
		}