I\'m really newbie in android and I would appreciate any help for my course work.
I need to do:
1) two ViewPagers (not nested) in one Activity
2) two
A solution about having a nested Viewpager and disabling the nested Viewpager swiping (if you want to set the selected pages with buttons in the nested)
For the nested You SubClass ViewPager and you add these:
public boolean onInterceptTouchEvent(MotionEvent event) {
//if you want to send the Touches to this Viewpager (the nested) //change true to false
return true;
}
@Override
public boolean onTouchEvent(MotionEvent event) {
// Never allow swiping to switch between pages on this inner
//send swipe to father instead of child
if (this.getParent()!=null && this.getParent() instanceof ViewPager) {
((ViewPager) this.getParent()).onTouchEvent(event);
}
return false;
}
In the Layouts you put this: