Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
int viewId = view.getId();
if (viewId == {
Ingredient ingredient = adapter.getItem(position);
final AlertDialog.Builder builder = getAlertBuilder(view, ingredientContract, ingredient);;
} else if (viewId == {
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