当用户点击返回时

当用户点击返回时

本文介绍了当用户点击返回时,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 的作用是

值"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插页式广告仍处于打开状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 05:36