In the process of developing an application for introducing a shopping list, I ran into an unpleasant problem.
There is a LinearLayout in it two ListView , and so, I need to make sure that not a ListView scrolled, but a LinearLayout along with the content from the ListView .
I tried to shove LinearLayout in ScrollView , as a result only the first element of each ListView displayed.

  ` <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@drawable/bg" > <ListView android:layout_margin="@dimen/padding_small" android:id="@+id/items2" android:divider="@android:color/transparent" android:layout_width="match_parent" android:layout_height="match_parent" tools:listitem="@layout/itemok" android:scrollbars="none" android:dividerHeight="@dimen/padding_small"/> <ListView android:layout_margin="@dimen/padding_small" android:id="@+id/items" android:divider="@android:color/transparent" android:layout_width="match_parent" android:layout_height="match_parent" tools:listitem="@layout/item" android:scrollbars="none" android:dividerHeight="@dimen/padding_small"/> </LinearLayout>` 

    1 answer 1

    Try assigning such a handler to your listView

     listView.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_MOVE) { return true; //Указывает, что это было обработано вами и больше не будет перенаправлено } return false; } }); 

    Taken from here and there are a lot of such topics on the Internet.