当用户点击返回时 Admob 插页式广告仍然打开

Admob interstitial ad still open when user comes back from clicking it

当用户点击插页式广告时,浏览器将打开或其他任何内容。当他导航回我的应用程序时,插页式广告仍然打开,他必须关闭它。

如何防止插页式广告在用户点击并导航回我的应用后仍然显示?

将以下内容添加到您的AndroidManifest.xml

<activity
        android:name="com.google.android.gms.ads.AdActivity"
        android:noHistory="true"/>

noHistory 的作用:

Whether or not the activity should be removed from the activity stack and finished (its finish() method called) when the user navigates away from it and it's no longer visible on screen — "true" if it should be finished, and "false" if not. The default value is "false".

A value of "true" means that the activity will not leave a historical trace. It will not remain in the activity stack for the task, so the user will not be able to return to it. In this case, onActivityResult() is never called if you start another activity for a result from this activity.

来源:https://developer.android.com/guide/topics/manifest/activity-element.html#nohist