Correctly detecting a swipe on a GridView placed inside a ViewPager in Android
<p>I have a ViewPager which uses GridViews for pages. I would like the ViewPager to switch pages when I swipe across the screen.</p>

<p>The problem is that swipes are not detected when they are made across the GridView. Outside of the GridView, the swipes work correctly; it seems that the GridView is trapping all touch events without passing it to ViewPager first.</p>

<p>While fiddling with the source code, I did this to a custom class extended from GridView:</p>

<pre><code>@Override
public boolean onTouchEvent(MotionEvent event) {
    return pager.onInterceptTouchEvent(event);
}
</code></pre>

<p>-- where <code>pager</code> refers to the ViewPager class. With this, ViewPager will correctly detect swipes and move pages accordingly, but it doesn't allow GridView to accept any events, so I can't click on the items.</p>

<p>What I would like to be able to do is correctly detect swipes in ViewPager and item clicks on GridView.</p>
