Android studio Interstitial Ad always displayed - android

I'm using admob with android studio.
I made a simple test use:
From my mainactivity.java i launch an interstitial ad before going through to the mainactivity2.java.
When the Interstitial ad is dismissed, i close the mainactivity.java with a finish();
Request.
When i press the back button on my phone the Interstitial ad is showing again.
Can someone explain me why ? I mean the first activity is supposed to be closed, so this mean the ad create his own activity ?
Thanks for help.

Related

how to stop unity ads sdk creating ads in background

Unity Android ads SDK has a severe problem: it will create an interstitial ad in the background while the user switches the app between foreground and background very quickly.
When the app's "onResume" is called, I will call Unity to show an interstitial ad. But if the app goes to the background before the ads showed, Unity SDK will also pop the ad. This's bad. How can I stop this?
Thanks!

W/Ads: It is not recommended to show an interstitial when app is not in foreground

Do you know this "W/Ads: It is not recommended to show an interstitial when app is not in foreground."
How can i prevent this Warning/Error , I'm trying to show an interstitial when app is on foreground but the device is lock,under security.
on some device i'm can display interstitial when the device is lock and on other device i'm block.
Any Ideas?
You try to show an interstitialAd while the Activity is not in foreground.
You have to check if your activity is in foreground. If so, show the ad.
For example implementing a lifecycle listener.
After resume check if ad is loaded and show it.
GGK

How to avoid destroying app when an AdMOb banner is clicked?

I am using AdMob banner adds in my game. When I click on the add, I want app to pause while the user is taken to the ad content.
What is happening is that the app is completely destroyed and onCreate is called when I go back to the app.
How to resolve this?

How to hide interstitial ads in Android

I am working with AdMob in Android, and I am using both interstitial and banner ads. I want to hide interstitial ads, but it seems that there is not any suitable methods for hiding it.
Please help if you have any solutions.
Thanks in advance.
Taking answer from here
this.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK));
As whenever you press on back button the interstitial ad is closed so firing the back button event will eventually close the interstitial ad. Rest depends on the requirement.
Note: This is not an official way of doing this. It is just and hack/workaround.
As this answer points
It is not possible to programmatically close an interstitial ad.
Hope this helps.

Admob interestitial causes app to close

I'm trying to integrate Admob interstitial ads to my android app and for some reason. Every time I open an ad it calls my activity onDestroy method witch results on my app being closed without any log-cat errors or messages.
Does anyone knows what may be causing my app to close once Admob interstitial is opened ?
Thanks in advance.
Android closes processes if needed when an application enters the background. You need to be able to handle the destruction of the activity. Look into saving instance states HERE

Categories

Resources