3

I am drawing objects in a SurfaceView so I decided to use a RelativeLayout to display ads. I have the following code in my onCreate method.

    v = new ViewHandler(this);
    super.onCreate(savedInstanceState);
    RelativeLayout layout = new RelativeLayout(this);
    AdView adView = new AdView(this);
    adView.setAdUnitId("MY_ID");
    adView.setAdSize(AdSize.BANNER);
    layout.addView(v);
    layout.addView(adView);
    setContentView(layout);
    AdRequest request = new AdRequest.Builder().build();
    adView.loadAd(request);

When I click on the ad it freezes up. I am assuming this is because the app doesn't have permissions to open the web browser and/or is affected by my app being set in immersive sticky mode. Is there any obvious errors with this or quick fixes?

  • 1
    Does LogCat say anything interesting? – user253751 May 28 '15 at 03:37
  • Logcat does not say anything at all when I click on the ad. I've also notice that some ads that change when you click on them work fine. Its only when you click the install button or anything that links you to something outside of the app. – asmayer1216 May 28 '15 at 03:42

0 Answers0