android - 当用户点击回来时,Admob 插页式广告仍然打开

标签 android admob interstitial

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

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

最佳答案

将以下内容添加到您的 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

关于android - 当用户点击回来时,Admob 插页式广告仍然打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46636235/

相关文章:

java - 所有按钮都从 Android fragment 打开相同的 Activity

ios - 在某些 iOS 事件中暂停 Admob Interstitial

java - AdMob 插页式广告在 Resume 上重复加载

android - 广告尺寸和广告单元 ID 必须在调用 loadAd 之前设置。应用程序正在崩溃

android - 如何控制通知组点击

java - 如何用另一个按钮更改(图像和功能)按钮

android - 如何将旋转按钮添加到 Android 图像裁剪屏幕?

android - ClassNotFoundException:在路径上找不到类:DexPathList

android - 在 Android 中集成 Admob 时出错

android - 每当我添加某个库并在元数据部分修改 androidmanifest.xml 时,flutter 应用程序都会崩溃