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?