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.
@Override
protected void onPause() {
super.onPause();
if (adView != null) {
LinearLayout layout = 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.
@Override
public void onResume(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"