Вопрос

I have a particular scenario where I want to hide the Admob AdView when the user has tapped the screen and show again after the 1 seconds of user inactivity on the application.

I have am successfully hiding the AdView and showing it again after user inactivity but the problem is:

I am detecting that either user tapped the screen or not through this method onUserInteraction().

This method is working fine but when I tap on the AdView itself, the AdView get hidden.

Which should not happen. The normal behavior of AdView is that it should open Intersticial Ad when tapping the AdView.

How can I resolve this issue? or where should I handle the Tap event of the user to decide wether the Ad should be hidden or intersticial Ad should be opened.

Это было полезно?

Решение

According to the documentation, onUserInteraction() intercepts events on the entire activity before they get fired on the views.

Depending on your application, you may want to use onTouchEvent() and onTrackballEvent() to only consume events not handled by your views. Or, alternatively, you could add event listeners to your views (not the AdView) to register for such events.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top