当用户点击插页式广告时,浏览器将打开或执行其他操作。当他导航回我的应用程序时,插页式广告仍然打开,他必须将其关闭。
如何防止用户点击插页式广告并导航回我的应用后仍然显示插页式广告?
最佳答案
将以下内容添加到您的 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/