I have a listview with clickable buttons in the row views, and a custom SimpleCursorAdapter to implement this list. Despite the onitemclicklistener not being fired when the row is clicked (see here), I have implemented a listener that works when touching the row item:
public View getView(int position, View convertView, ViewGroup parent) {
.................................
convertView.setOnClickListener(new OnItemClickListener(position));
}
public class OnItemClickListener implements OnClickListener{
private int mPosition;
OnItemClickListener(int position){
mPosition = position;
}
public void onClick(View view) {
}
}
There are two problems with this - it takes two touches to fire the onitemclick listener, presumably one to focus and one to fire, and it's impossible to select the row using the trackball.
I have tried some of the workaround listed on SO, inlcuding making the button not focusable, and some other methods here, but didn't get anywhere. As that link points out, Google accomplish it themselves with the call log application. That seems to be achieved with ListActivities though - I am using a Tab Activity with several lists in the same tab.