1
I’ve got a listview that extends a basedapter. And following this one’s lead topical with the @ramaral reply I was able to make the item select and select but now how do I check if the item is selected?
listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (view.isSelected()){
Toast.makeText(lista.getContext(),"SELECIONADO",Toast.LENGTH_SHORT).show();
}else {
Toast.makeText(lista.getContext(),"NÃO SELECIONADO",Toast.LENGTH_SHORT).show();
}
}
});
With this code it is only displaying : "NOT SELECTED" Regardless of whether the item is selected or not. Can you help me?
It worked, vlw!
– L.J