Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

HybridWebView does not navigate

$
0
0

I tried many things for navigate to Google just simple way with HybridWebView. But its not workig. If its can navigate to an url i will try add javascript and run it finaly get result. But still does not navigate to url.
Some body can help to me? Is there any example working?

Notice : And I didnt add from axml file. Its gave me XML implement error. Alread i dont need to see in Activity. Its will work code behind. Acctualy I getting a response from a web page. I can do this with HttpRequest Response or OkHttp but when i use them program crashing about Ram.

MyCodes
using XLabs.Forms.Controls;
using Xamarin.Forms;
using XLabs.Serialization.JsonNET;

namespace HybridTest
{
    public class JavaScriptHelper
    {
        public HybridWebView Browser;
        JavaScriptHelper()
        {
            Browser = new HybridWebView(new JsonSerializer());
            Browser.LoadFinished += LoadFinished;
            Browser.RegisterCallback("dataCallcack", JsCallback);

            Browser.Uri = new Uri("http://www.google.com");

            // OR Trying this
            //HtmlWebViewSource source = new HtmlWebViewSource();
            //source.HTML = @"HTML Code here";
            //Browser.Source = source;
        }
    }

    private void LoadFinished(object sender, EventArgs e)
    {
        //Debug point
    }

    private void JsCallback(string result)
    {
        //Debug point
    }
}

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>