Skip to content

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. #1

@mrseeneline

Description

@mrseeneline

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);
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions