0

I am working on a phonegap app using jquery mobile. I need to open a page from some website do perform some action. I am using in app browser for it. It opens the required page successfully but on pressing close button (there's a X symbol on top right) it does not close. To check whether even is being triggered or not I added

    ref.addEventListener('exit', function(event) {alert(event.type);

This is producing alert, so I think There is not any problem in event.

The other solution That i tried from here mobile/close

My code that opens inAppBrowser is here Github source

Since I am continuously tring solutions there might be changes in code but I will comment them, So my trials will be their.

When I click X, The screen blinks (or i say it's like you turn over a page in book), or it's like there are two same inAppBrowser windows. One gets closed on clicking X and other is still there.

I found somewhere that on clicking done it gets closed but there is not any done button. This is screenshot of inAppBrowser Screen shot from my android mobile

Community
  • 1
  • 1

1 Answers1

0

You need to use loadstop event handler here to close InAppBrowser.

ref.addEventListener('loadstop', function(event) {
  if (event.url.match("mobile/close")) {
   ref.close();
  }
});
Andy
  • 521
  • 3
  • 6
  • 22