In an Android project I am working on I have a ListActivity that is set up like this:
public class myClass extends ListActivity {
public void onCreate(Bundle savedInstanceState) {
...
String[] menuItems = new String[] { "View", "Share", "Delete" };
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, menuItems);
setListAdapter(adapter);
...
}
}
The 3 menu items show up fine, but only the text portion of the item can be “clicked”. How can I make it so that the entire row is “clickable”?
The width of “clickable” area is determined by the layout of the list and of it’s items.
By layout I mean those XML files in res/layout.
You have to set android:layout_width=”fill_parent” for ListView and the items.
I see that you are using a ListView, if you are not loading a custom layout for the list, then simple_list_item_1.xml should be the problem.
Please post that file if the problem persists.