Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
adapter.getItem(position).setChecked(!adapter.getItem(position).isChecked());
adapter.notifyDataSetChanged();
deleteButton.setVisibility(adapter.isAnyItemSelected()? View.VISIBLE : View.INVISIBLE);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment