Exemplo n.º 1
0
        private void CallExitMenu()
        {
            var builder = new Android.App.AlertDialog.Builder(this);

            builder.SetTitle(TranslationHelper.GetString("exitWithoutSavingData", _ci));
            builder.SetNegativeButton(TranslationHelper.GetString("cancel", _ci), (object sender1, DialogClickEventArgs e1) => { });
            builder.SetCancelable(true);
            builder.SetPositiveButton(TranslationHelper.GetString("confirm", _ci), (object sender1, DialogClickEventArgs e1) =>
            {
                Intent intent;
                if (_databaseMethods.UserExists() && _databaseMethods.GetCardNames()?.Count > 0)
                {
                    intent = new Intent(this, typeof(QrActivity));
                }
                else
                {
                    intent = new Intent(this, typeof(MyCardActivity));
                }
                intent.AddFlags(ActivityFlags.ClearTop); // Removes other Activities from stack
                StartActivity(intent);
            });
            Android.App.AlertDialog dialog = builder.Create();
            dialog.Show();
        }