protected void ShowErrorForNativeUIAlert(string v)
 {
     if (this.ShowErrors)
     {
         global::Android.Content.Context c = global::Android.App.Application.Context;
         new Plugin.Threading.UIThreadRunInvoker(c).BeginInvokeOnUIThread
         (
             () =>
         {
             var b = new global::Android.App.AlertDialog.Builder(c);
             b.SetMessage(v);
             b.SetTitle("Warning");
             b.SetNeutralButton
             (
                 "OK",
                 (s, e) =>
             {
                 ((global::Android.App.AlertDialog)s).Cancel();
             }
             );
             var alert = b.Create();
             alert.Show();
         }
         );
         return;
     }
 }
Ejemplo n.º 2
0
        private void BtnResetAll_Click(object sender, System.EventArgs e)
        {
            var a = new global::Android.App.AlertDialog.Builder(this).Create();

            a.SetTitle(Resources.GetString(Resource.String.caution));
            a.SetMessage(Resources.GetString(Resource.String.reset_all_warn));
            a.SetButton(Resources.GetString(Resource.String.ok), (s, d) =>
            {
                File.Delete(Path.Combine(IOHelper.GetDataPath(), "config.pc"));
                System.Environment.Exit(0);
            });
            a.SetButton2(Resources.GetString(Resource.String.cancel), (s, d) => { });
            a.Show();
        }