I'm trying to add an interstitial to my app that uses setContentView. I've already got a "listener" implemented that properly calls whenever an ad is needed. You can abbreviate your answer by calling this function "Listener"{...} and assume that everything within the brackets will occur whenever the app signals for an ad. The following answer has a good method for Banner ads.
Implementing Admob banner when setContentView() is used for the Surfaceview
My question is, in this scenario, how should I implement an interstitial?
My code is basically the answer from the link, plus this:
...
setContentView(layout);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
listener= new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getPropertyName()=="sharing1") {
caring();
game.dead=false;
game.sharing1=false;
}
if(event.getPropertyName()=="dead")
{
//Make an interstitial ad here
}
}
};