Have following piece of layout:
<LinearLayout android:id="@+id/colleagues_show_email_linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:clickable="true"
android:background="?attr/clickableItemBackground">
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher"/>
<TextView android:id="@+id/colleagues_show_email_textView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"/>
</LinearLayout>
When i click on ImageView, LinearLayout changes background the same way as in the ListView. But clicking on TextView doesn't change background. What's wrong?
Update I had a View.OnClickListener (with only onClick(View v) {Log.d(TAG, "Email onClick"); }) on the TextView and that was the issue. After removing setOnClickListener line it starts to work as expected.