I would like to click anywhere (empty area) as a list

As a new Android programmer, I have the required todo app. This is acceptable for Christmas shopping, but I would really like to make the whole line of the list of items pressed. Now I have to click the text. The shorter the element, the harder it is to hit.

My main activity extends ListActivity. I use a subclass of ResourceCursorAdapter for the list itself. My layout looks like this (thanks!):

<?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/todo_row" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <CheckBox android:text="" android:id="@+id/todo_checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:focusable="false" android:checked="false" ></CheckBox> <TextView android:text="" android:id="@+id/todo_text" android:layout_width="fill_parent" android:layout_height="wrap_content" ></TextView> </LinearLayout> 
+2
android listview
source share
1 answer

Clicking anywhere in the line is the default behavior of listView. How do you configure onClick listeners? You must use onItemClickListener .

+1
source share

All Articles