Skip to content Skip to sidebar Skip to footer

Admob With Phonegap 3.0 On Resume Displays Blank Page Until Screen Is Touched

I've made an app using PhoneGap 3.0, which includes the Google AdMob and Facebook SDKs. Sometimes, after the app is suspended (by pressing 'home' for example), when it's launched a

Solution 1:

To work around the problem I remove the AdView when the app is paused, and create it again when it's resumed.

@OverrideprotectedvoidonPause() {
  super.onPause();

  if (adView != null) {
    LinearLayoutlayout=super.root;
    layout.removeView(adView);
  }
}

This works fine so will do for now. It also prevents the AdView from continuing to load ads in the background so that's a bonus.

If anyone has any better answers feel free to let me know!

Solution 2:

You need override to response to onResume event.

@OverridepublicvoidonResume(boolean multitasking) {
    super.onResume(multitasking);
    if (adView != null) {
        adView.resume();
    }
}

Post a Comment for "Admob With Phonegap 3.0 On Resume Displays Blank Page Until Screen Is Touched"