0

I am working on Interstitial Ads and implementing them in our Android App. I have been successful in implementing them, however I came across an interesting problem.

When an Interstitial Ad is being displayed and if you minimize the App (use home key), on next launch of the App, the ad is being launched. Though this seems like an expected behaviour technically, but this is bad in our application as we close the Application when ad gets shown.

Is there any way of knowing when the Ad is being displayed and if someone minimizes app, then we close the Interstitial Ad, so that on next launch the App launch happens normally from SplashScreen.

I checked the AdListener but none of them gives callback about the lifecycle of the App like onPause and onResume.

I would appreciate if someone can suggest some hacks either for this issue.

Roadblock
  • 2,041
  • 2
  • 24
  • 38

1 Answers1

0

In your AndroidMainifest.xml file add:

android:noHistory="true" to the AdActivity activity

Like this:

<activity android:name="com.google.android.gms.ads.AdActivity"
   android:noHistory="true"
 android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
</activity>

Refer: this

ilbose
  • 747
  • 13
  • 21
Myth
  • 1,218
  • 12
  • 15
  • I have not added any adActivity. I have updated the question to include a link to InterstitialAd. There is no requirement to include the AdActivity in the Manifest. – Roadblock Oct 10 '16 at 13:00