I'm trying to implement a clickable scrollview:
findViewById(R.id.parent_view).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Log.d("", "onClick");
}
});
<LinearLayout
android:id="@+id/parent_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:clickable="true">
<ScrollView
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="left|center_vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
</ScrollView>
<ScrollView
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="left|center_vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
</ScrollView>
</LinearLayout>
It seems like the scrollview consumes all touch events and therefore the onClick method is never triggered. Is there any way to maintain the scrolling functionality and also make it clickable?