public class Interstitial extends Activity implements InterstitialAdListener{
private BA ba;
private String eventName;
private MoPubInterstitial mInterstitial;
public void InitializeMopub_Interstitial(final BA ba, String EventName , String MoPub_AdUnitID )
{
mInterstitial = new MoPubInterstitial(ba.activity, MoPub_AdUnitID);
this.ba = ba;
this.eventName = EventName.toLowerCase(BA.cul);
this.mInterstitial.setInterstitialAdListener(this);
}
@Override
public void onInterstitialLoaded(MoPubInterstitial arg0) {
// TODO Auto-generated method stub
ba.raiseEvent(this, this.eventName + "_mopub_interstitial_loaded", new Object[0]);
}
@Override
public void onInterstitialShown(MoPubInterstitial arg0) {
// TODO Auto-generated method stub
ba.raiseEvent(this, this.eventName + "_mopub_interstitial_shown", new Object[0]);
}
/**
* Preload Mopub interstitial
*/
public void PreloadMopub_Interstitial () {
mInterstitial.load();
}
/**
* Shows Mopub interstitial
*/
public void ShowMopub_Interstitial () {
if (mInterstitial != null) {
if (mInterstitial.isReady()) {
mInterstitial.show();
}
}
}
}