1

I have an issue in which when I pop open a childbrowser: if a user is using their 3G or has a slow connection, there can be a long waiting period before any content is loaded (just a blank white screen).

Is there a way to minimize or hide the child dialog until it has loaded its content and then display it when it has loaded (would use a loading overlay up to this point)?

Any help would be much appreciated.

Mat
  • 202,337
  • 40
  • 393
  • 406
Phil Jackson
  • 10,238
  • 23
  • 96
  • 130

1 Answers1

1

Hmmm...that's an interesting one. First off you'd have to comment out the dialog.show() command in the showWebPage() method of the ChildBrowser. Then in the inner class ChildBrowserClient you'd need to override the method onPageFinished(). Once you get the page finished event then you could call dialog.show().

I haven't tried it yet but that is probably enough to get you going.

Simon MacDonald
  • 23,253
  • 5
  • 58
  • 74
  • Will have a look into it and post back – Phil Jackson Apr 03 '12 at 13:10
  • Yeah, you'll have to create one that over rides the onPageFinished that is inherited from https://developer.android.com/reference/android/webkit/WebViewClient.html – Simon MacDonald Apr 03 '12 at 13:16
  • Hmmm, I have kinda got there but the onPageFinished works pretty much the same as onLocationChange which means on the first load it does work only opening when the browser has opened but when it comes to the Facebook login which i'm working on, it keeps triggering on redirect to... hmmm Cheers anyway, will accept this as the answer but will post a full one when complete. – Phil Jackson Apr 03 '12 at 13:34