I had to improve Deepthi's solution since it didn't work for me; I guess because my child scrollview is full of views (I mean child views use all of the scrollview drawing space). To make it fully functional, I had to also disallow the touch request for parent scroll on touch of all children views inside the child scroll view:
parentScrollView.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event)
{
findViewById(R.id.childScrollView).getParent().requestDisallowInterceptTouchEvent(false);
return false;
}
});
childScrollView.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event)
{
// Disallow the touch request for parent scroll on touch of
// child view
v.getParent().requestDisallowInterceptTouchEvent(true);
return false;
}
});`
childScrollviewRecursiveLoopChildren(parentScrollView, childScrollView);
public void childScrollviewRecursiveLoopChildren(final ScrollView parentScrollView, View parent) {
for (int i = ((ViewGroup) parent).getChildCount() - 1; i >= 0; i--) {
final View child = ((ViewGroup) parent).getChildAt(i);
if (child instanceof ViewGroup) {
childScrollviewRecursiveLoopChildren(parentScrollView, (ViewGroup) child);
} else {
child.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event)
{
// Disallow the touch request for parent scroll on touch of
// child view
parentScrollView.requestDisallowInterceptTouchEvent(true);
return false;
}
});
}
}
}