Hi Rocky,
It looks like you are having an Up navigation button in your Action Bar. In that case, if you want to show an Interstitial Ad before you go back to the previous Activity, then you must call InterstitialAdView.show() in the onOptionsItemSelected() method. Then in the onAdClosed(), simply navigate yourself back to old Activity.
For example:
In the onOptionsItemSelected() method:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
if (mInterstitialAd != null && mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
} else {
NavUtils.navigateUpFromSameTask(this);
}
return true;
}
return super.onOptionsItemSelected(item);
}
And then in the onAdClosed() method:
@Override
public void onAdClosed() {
NavUtils.navigateUpFromSameTask(this);
}
Thanks,
Veer Busani
Mobile Ads SDK Team