how to work with pop ups window in android webview
Asked Answered
B

1

4

I am developing browser like application using a Webview for my own understanding.

I am not yet clear how to work with pop-ups in android Webview.

I came across these methods onJsAlert(), onJsBeforeUnload(), onJsConfirm() etc to handle java script pop ups. from this link and also developer link

these work when there is a jsAlert but how do i handle pop-up which opens in new window ?

I just want to know is there is any other way to handle pop up for websites in android webview like opening in new tab or open in new window using webview.

I am also having trouble to open urls which are opened in new window in normal browser.e.h If I open some link from twitter then this url is not loaded but twitter logo is seen similar to one of the questions here

here is the snap shot from normal android browser but this is loaded in my webview as a normal page not as pop-up

enter image description here

Buttercup answered 16/4, 2012 at 6:54 Comment(0)
M
4

Try

 webViewObject.getSettings().setJavaScriptCanOpenWindowsAutomatically(true)

if you want to open window...like window.open thn its required. for the javascriptenable should be set to true.. hope i understand ur quest correct.

Mckinnon answered 16/4, 2012 at 7:48 Comment(2)
this didn't work in my scenario I already have set this flag I am having similar problem like here problem is that Pop-up window is not shown and getting issues while loading url in new view.Buttercup
Did you found the solution?Connate

© 2022 - 2024 — McMap. All rights reserved.