当用户点击返回时,Admob插页式广告仍处于打开状态 [英] Admob interstitial ad still open when user comes back from clicking it

查看:78
本文介绍了当用户点击返回时,Admob插页式广告仍处于打开状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户单击插页式广告时,浏览器将打开或打开.当他导航回到我的应用程序时,插页式广告仍处于打开状态,因此必须将其关闭.

When a user clicks an interstitial ad, the browser will open or whatever. When he navigates back to my app, the interstitial ad is still open and he has to close it.

如何在用户单击插页式广告并导航回我的应用后阻止其继续显示?

How can I prevent an interstitial ad from still being displayed after the user clicked it and navigates back to my app?

推荐答案

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

Add the following to your AndroidManifest.xml:

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

noHistory 的作用是

当用户离开该活动并且在屏幕上不再可见该活动时,是否应该从该活动堆栈中删除该活动并完成(调用了finish()方法)-如果应该完成,则为"true",并且如果不是,则为"false".默认值为"false".

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".

值"true"表示该活动不会保留历史记录痕迹.它不会保留在任务的活动堆栈中,因此用户将无法返回到它.在这种情况下,如果您为某个活动启动另一个活动,则永远不会调用onActivityResult().这项活动的结果.

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

这篇关于当用户点击返回时,Admob插页式广告仍处于打开状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆