示例#1
0
 public bool onJsAlert(WebView view, String url, String message, JsResult result)
 {
     System.Console.WriteLine("Message!!!  " + message);
     Log.Debug("LogTag", message);
     result.Confirm();
     return(true);
 }
示例#2
0
            public override bool OnJsAlert(WebView view, string url, string message, JsResult result)
            {
                var alertDialogBuilder = new AlertDialog.Builder(context)
                                         .SetMessage(message)
                                         .SetCancelable(false)
                                         .SetPositiveButton("Ok", (sender, args) => {
                    result.Confirm();
                });

                alertDialogBuilder.Create().Show();

                return(true);
            }
            public override bool OnJsAlert(WebView view, string url, string message, JsResult result)
            {
                var alertDialogBuilder = new AlertDialog.Builder (context)
                    .SetMessage (message)
                    .SetCancelable (false)
                    .SetPositiveButton ("Ok", (sender, args) => {
                        result.Confirm ();
                    });

                alertDialogBuilder.Create().Show();

                return true;
            }
示例#4
0
 public override bool OnJsAlert(WebView view, string url, string message, JsResult result)
 {
     Android.App.AlertDialog alertDialog = new Android.App.AlertDialog.Builder(activity)
                                           .SetTitle("提示")
                                           .SetMessage(message)
                                           .SetPositiveButton("确定", (s, e) =>
     {
         result.Confirm();
     })
                                           .Create();
     alertDialog.Show();
     return(true);
 }
        public override bool OnJsAlert(WebView view, string url, string message, JsResult result)
        {
            AlertDialog.Builder dialog = new AlertDialog.Builder(_activity);
            AlertDialog         alert  = dialog.Create();

            alert.SetTitle("");
            alert.SetMessage(message);
            alert.SetButton("OK", (c, ev) =>
            {
            });
            alert.Show();
            result.Confirm();
            return(true);
        }
示例#6
0
        /// <summary>
        /// Alertを表示する
        /// </summary>
        /// <param name="view"></param>
        /// <param name="url"></param>
        /// <param name="message"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public override bool OnJsAlert(WebView view, string url, string message, JsResult result)
        {
            var dialog = new AlertDialog.Builder(view.Context);
            var dlg    = dialog.SetTitle("!")
                         .SetIcon(ContextCompat.GetDrawable(view.Context, Android.Resource.Drawable.IcDialogAlert))
                         .SetMessage(message)
                         .SetPositiveButton(Android.Resource.String.Ok, (object sender, DialogClickEventArgs args) =>
            {
                result.Confirm();
            }).Create();

            dlg.SetCanceledOnTouchOutside(false);
            dlg.Show();
            return(true);
        }
        public override bool OnJsAlert(WebView view, string url, string message, JsResult result)
        {
            string userName = message.Split(new string[] { "~_*_~" }, StringSplitOptions.None)[0];
            string password = message.Split(new string[] { "~_*_~" }, StringSplitOptions.None)[1];
            Dictionary <string, string> data = new UserPasswordData().getUserPasswordDatas();

            foreach (KeyValuePair <string, string> value in data)
            {
                if (value.Key == userName && value.Value == password)
                {
                    Toast.MakeText(Application.Context, "Welcome!", ToastLength.Short).Show();
                    result.Confirm();
                    Intent myIntent;
                    myIntent = new Intent(Application.Context, typeof(MainActivity));
                    myIntent.SetFlags(ActivityFlags.NewTask);
                    Application.Context.StartActivity(myIntent);
                    return(true);
                }
            }

            Toast.MakeText(Application.Context, "Login failed.", ToastLength.Short).Show();
            result.Confirm();
            return(true);
        }
示例#8
0
            /// <param name="view">The WebView that initiated the callback.</param>
            /// <param name="url">The url of the page requesting the dialog.</param>
            /// <param name="message">Message to be displayed in the window.</param>
            /// <param name="result">A JsResult used to send the user's response to
            ///  javascript.</param>
            /// <summary>
            /// Fired when a javascript confirm should be shown
            /// </summary>
            /// <returns>To be added.</returns>
            public override bool OnJsConfirm(WebView view, string url, string message, JsResult result)
            {
                var alertDialogBuilder = new AlertDialog.Builder(this.m_context)
                                         .SetMessage(message)
                                         .SetCancelable(false)
                                         .SetPositiveButton(this.m_context.Resources.GetString(Resource.String.confirm), (sender, args) =>
                {
                    result.Confirm();
                })
                                         .SetNegativeButton(this.m_context.Resources.GetString(Resource.String.cancel), (sender, args) =>
                {
                    result.Cancel();
                });

                alertDialogBuilder.Create().Show();

                return(true);
            }
 private void OkAction(object sender, DialogClickEventArgs e)
 {
     _res.Confirm();
 }
示例#10
0
文件: Web.cs 项目: eatage/AppTest
 public override bool OnJsConfirm(WebView view, string url, string message, JsResult result)
 {
     new AlertDialog.Builder(_context).SetTitle("提示").SetMessage(message).SetPositiveButton("确定", delegate
     {
         result.Confirm();
     }).SetNegativeButton("取消", delegate { result.Cancel(); }).SetCancelable(false).Create().Show();
     return true;
 }