I have horizontal scrolling pages as in the android market (ViewPager).
My problem is that i want to have a Horizontal Scrolling View in them with some images?Is tha
You need to extend the HorizontalScrollView and intercept touch events. What worked for me was the following sample:
public class MyScrollView extends HorizontalScrollView {
public MyScrollView(Context p_context, AttributeSet p_attrs)
{
super(p_context, p_attrs);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent p_event)
{
return true;
}
@Override
public boolean onTouchEvent(MotionEvent p_event)
{
if (p_event.getAction() == MotionEvent.ACTION_MOVE && getParent() != null)
{
getParent().requestDisallowInterceptTouchEvent(true);
}
return super.onTouchEvent(p_event);
}
}
Then, instead of using the HorizontalScrollView in your layout XML, you need to use this custom view.
What helped me get to this solution is this post