AdMob-Qt5.2-Example
AdMob-Qt5.2-Example copied to clipboard
Bug: FATAL EXCEPTION: E/AndroidRuntime(28178): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
In AdMobQtActivity.java public void onCreate()->mAdView.setAdListener(...) should remove old mAdvView if it exists before adding new:
mAdView.setAdListener( new AdListener() {
public void onAdLoaded(){
if (mAdView instanceof ViewGroup)
{
System.out.println("remove old adview if exists");
viewGroup.removeView(mAdView);
}
System.out.println("add new adview");
viewGroup.addView(mAdView);
}
}