I have been trying to find a solution for this for hours and it feels like I searched every question on stackoverflow and tried everything in the layout. Before I tried the layout displayed below, the edittext and the two imagebuttons were inside the scrollview. In this old layout the ontouch worked perfectly in my fragment, however once I pulled out the relative layout with the edittext and the two image buttons the ontouch was not fired. Can someone help me with this problem? Any help is appreciated. Thanks
View fragmentView = inflater.inflate(R.layout.request, container, false);
fragmentView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
}
}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#BDCCE0" >
<EditText
android:id="@+id/etsearch"
android:layout_width="210dp"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginTop="10dp"
android:hint="search..."
android:singleLine="true"
android:imeOptions="actionDone" />
<ImageButton
android:id="@+id/bsearch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/etsearch"
android:layout_marginTop="9dp"
android:src="@drawable/search" />
<ImageButton
android:id="@+id/bupdaterequests"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_toRightOf="@id/bsearch"
android:layout_marginTop="9dp"
android:src="@drawable/refresh" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:background="#BDCCE0"
android:layout_below="@id/etsearch" >
<TableLayout
android:id="@+id/myTableLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</TableLayout>
</ScrollView>
</RelativeLayout>