javascript - window.close() not working in android webview? -


itemprop = "text">

Eclipse test on Android 4.1 device

I am trying to open an html / javascript webpage, My localhost is hosted now, through a webview in my Android application. The page below estimates to close the bus after 2 seconds with the code

    

I'm able to get a Hello warning using WebChromeClient. But the window is still not working. Any help would be appreciated.

PS: Here's how I am loading the URL:

  WebSettings ws = webView.getSettings (); Ws.setJavaScriptEnabled (true); Ws.setJavaScriptCanOpenWindowsAutomatically (true); WebView.loadUrl ("http://192.168.1.137/abc.html"); WebView.setWebChromeClient (New WebChromeClient ());    

Try it out:

  WebChromeClient webClient = new WebChromeClient () {Close window on window (public window) {super.onCloseWindow (w); Log D. (Tag, "window closed"); }};   

Description:

  Public Zero Variant Wide (WebView Window)   

To turn off the given webview Notify the host application and remove it from view system if necessary. At this point, Webcor has stopped any loading in this window and has removed any cross-scripting capability in Javascript.

Comments

Popular posts from this blog

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -

c++ - Redefined variable in the other module -