Code example for ViewPager

Methods: setCurrentItem

     * Show the filter at the supplied index, with animation 
     * @param index 
    public void showFilter(int index) {
        setCurrentItem(index, true);
     * Returns the currently showing fragment 
     * @return 
    public TaskListFragment getCurrentFragment() { 
        return (TaskListFragment) ((TaskListFragmentPagerAdapter) getAdapter()).lookupFragmentForPosition(getCurrentItem()); 
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        if (checkForPeopleHeaderScroll(ev))
            return false; 
Stop searching for code, let great code find you!  Add Codota to your java IDE