jomart mirza
asked on
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 ..
its working by default when using crosswalk in android studio ..
ASKER
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
Ok, I see, could you please share with as the relevant part of your code.
ASKER
sure this is what i tried :
but its not working ..
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.BaseCo ntext, this);
view.AddView(xwv);
this.AddContentView(view, new ViewGroup.LayoutParams(mp,mp));
XWalkPreferences.SetValue("enable-ja vascript", true);
xwv.SetResourceClient(new XWalkResourceClient(xwv));\\ this code should work
xwv.SetUIClient(new XWalkUIClient(xwv));\\or this
xwv.LoadUrl("file:///android_asset/i ndex.html" );
}
}
}
but its not working ..
Could you check if the JS is enabled using "getJavaScriptEnabled()" and make sure there's no message error logged.
ASKER
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
ASKER
when i press this HTML component it should give me dialog :
i get this in log output :
<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
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Open in new window
Take a look at this discussion, It may be helpful in your case :
https://issuetracker.google.com/issues/36905249