So I am making a Listview using my custom adapter. The adapter layout is shown below
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TextView
android:id="@+id/textViewName"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
Then I set onItemClickListener to the ListView and it is doing fine. Then when I added a button to the layout become
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TextView
android:id="@+id/textViewName"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:text="edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
the ListView is no longer clickable. What I want to achieve is when I click on the ListView will show profile description. then when I tap on the button, it will lead to profile edit activity.
Can you check if the button is taking away all the clicks generated on the row?
Try to restrict the button touch area to a piece of the row or try setting
android:focusable="false"for the button if you wish the button to be not clickable.