Domanda

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...

È stato utile?

Soluzione

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

Altri suggerimenti

set android:descendantFocusability="blocksDescendants" its row xml file and you can try for list view whatever best suit for you.check all op

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top