alert dialog from javascript not appear in xamarin crosswalk webview

how to show java-script alerts and HTML dialog input in Xamarin crosswalk ????
its working by default when using crosswalk in android studio ..
jomart mirzaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Zakaria AcharkiAnalyst DeveloperCommented:
Setting the WebChromeClient is needed to get the alert() , try set it like :

mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setWebChromeClient(new WebChromeClient());

Open in new window


Take a look at this discussion, It may be helpful in your case :

https://issuetracker.google.com/issues/36905249
jomart mirzaAuthor Commented:
yes this is for  built-in web view  but for crosswalk web view alert not working by default in Xamarin  like android studio i search google a lot didn't find anything it had to be some solution
Zakaria AcharkiAnalyst DeveloperCommented:
Ok, I see, could you please share with as the relevant part of your code.
Maximize Customer Retention with Superior Service

The IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more to help build customer satisfaction and retention.

jomart mirzaAuthor Commented:
sure this is what i tried :

using Android.App;
using Android.Widget;
using Android.OS;
using System;
using Android.Views;
using Android.Content.Res;
using System.IO;

using Android.Util;
using Android.Content;
using System.Threading;
using System.Threading.Tasks;
using System.Text;
using System.Text.RegularExpressions;
using Org.Xwalk.Core;

namespace XWalk
{
    [Activity(Label = "XWalk", MainLauncher = true)]
    public class MainActivity : XWalkActivity
    {

        public static Activity fa;
        public Org.Xwalk.Core.XWalkView xwv;

        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
        }

        protected override void OnXWalkReady()
        {
            fa = this;

            var view = new RelativeLayout(this.BaseContext);
            var mp = ViewGroup.LayoutParams.MatchParent;
            xwv = new Org.Xwalk.Core.XWalkView(this.BaseContext, this);
            view.AddView(xwv);
            this.AddContentView(view, new ViewGroup.LayoutParams(mp, mp));
            XWalkPreferences.SetValue("enable-javascript", true);
            xwv.SetResourceClient(new XWalkResourceClient(xwv));\\ this code should work
            xwv.SetUIClient(new XWalkUIClient(xwv));\\or this
            xwv.LoadUrl("file:///android_asset/index.html");
   
        }
}
}

but its not working ..
Zakaria AcharkiAnalyst DeveloperCommented:
Could you check if the JS is enabled using "getJavaScriptEnabled()" and make sure there's no message error logged.
jomart mirzaAuthor Commented:
JavaScript is enabled by default and i test it in other js function and its working  but the alert function and anything need dialog is not appears  so i even hired some one to find me an answer and i'm still waiting because i really supersized that i didn't find any easy solution for this issue
jomart mirzaAuthor Commented:
when i press  this HTML component it should give me dialog :

 <select>
            <option value="volvo">Volvo</option>
            <option value="saab">Saab</option>
            <option value="mercedes">Mercedes</option>
            <option value="audi">Audi</option>
        </select>


i get this in log output :

01-16 12:07:42.117 V/BoostFramework( 5609): BoostFramework() : mPerf = com.qualcomm.qti.Performance@48196b1
01-16 12:07:42.117 D/HwCust  ( 5609): Create obj success use class android.widget.HwCustTextViewImpl
01-16 12:07:42.127 D/HwCust  ( 5609): Create obj success use class android.widget.HwCustTextViewImpl
01-16 12:07:42.127 D/HwCust  ( 5609): Create obj success use class android.widget.HwCustTextViewImpl
01-16 12:07:42.137 D/HwCust  ( 5609): Create obj success use class android.widget.HwCustTextViewImpl
01-16 12:07:42.147 E/Dialog  ( 5609): show mWindowManager.addView RuntimeException
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.