My main activity calls my Surfaceview game, setting a layout with an adview and surfaceview added (initially I did not use a layout at all before I had to ad the banner). however I have not been able to access the main activity from surfaceview to change the layout so it doesn't include the adview once the game starts. i'm forced to have the banner on continually because of this. attempts to kill the ad still leaves a blank banner. does anyone know how to access main activity functions from surfaceview.
I created a removead()
function in the main activity to define a new contextview without the adView, but I can't access it.
context
, the main activity, is passed to the Surfaceview on creation. I've tried:
context.removead();
this.getContext().removead();
((Activity) this.getContext()).removead();
ViewGroup vg = (ViewGroup)(
this.getParent());
vg.removeView(adView);