Android detects

I have a viewpager with webviews and I want to find out that the user generally spent.

I basically want to count how many times they slipped between views.

The problem with maintaining a position in the viewpager is that it may not keep track of the position of your view, as it constantly generates views of +1 and -1 away from where you are.

So, my next way to get this was with the counts that the user made. Only the horizontal scroll view that will change the viewpager

I thought this would be relevant to the gesture listener and some directional logic, but I'm not sure.

I was also wondering if touch recognition of the viewpager and web browser would make it difficult to detect gestures in another overriden function just for counting.

insight appreciated

+3
source share
1 answer

ViewPagers allows you to set onPageChangeListener with setOnPageChangeListener(). OnPageChangeListener has an onPageSelected method that will be called every time the user turns the page. You can increase the score inside this method to track page views.

+9
source

All Articles