Reputation: 40
I've got this problem that I cannot receive this event, something is blocking it from one of my items in the listView but I don't know what, I checked focus on the item set to false and it not worked. Also check setting the item to be onlongclickable but it didn't work also. What more?
Upvotes: 1
Views: 240
Reputation: 844
you can do something like this in your ListView Adapter ,getView() ,
// For onlongclicks
final View deleteView = convertView;
deleteView.setOnLongClickListener(new OnLongClickListener() {
@Override
public boolean onLongClick(final View v) {
// TODO Auto-generated method stub
}
});
//For Just onClick
deleteView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
}
});
Upvotes: 0
Reputation: 1364
I had a problem with that and set the parent of the layout android:descendantFocusability="blocksDescendants"
, this is the list view item layout
Upvotes: 1