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

Community
  • 1
  • 1
nishi
  • 1,245
  • 3
  • 13
  • 22

1 Answers1

3

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.

user1140237
  • 5,015
  • 1
  • 28
  • 56
  • 4
    this didn't work in my scenario I already have set this flag I am having similar problem like [here](http://stackoverflow.com/questions/8647383/open-pop-up-external-site-link-in-current-webview) problem is that Pop-up window is not shown and getting issues while loading url in new view. – nishi Apr 16 '12 at 08:49
  • Did you found the solution? – Arun Shankar Mar 21 '16 at 04:59