androidlistviewonclicklistenerandroid-holo-everywhere

How can I make a ListView clickable? (NOT item clicks!)


I use an Adapter with a ListView...

I want to trigger the ListView click and disable item clicks (visually)

In my Adapter I do something like to disable visual click feedback:

@Override
public View getView(int pos, View convertView, ViewGroup parent)
{
    if (convertView == null)
        convertView = LayoutInflater.from(mParent).inflate(R.layout.row_set, null);

    convertView.setClickable(false);
    convertView.setFocusable(false);
    convertView.setFocusableInTouchMode(false);

    ...

    return convertView;
}

but that does not work either.

Setting an OnClickListener on a ListView isn't allowed as well, so I don't know how to trigger a click on the ListView

I would like to have unclickable items and a clickable listview...


Solution

  • Try to set your own touchListener,and to handle touch events