Example usage for android.widget AdapterView setOnItemLongClickListener

List of usage examples for android.widget AdapterView setOnItemLongClickListener

Introduction

In this page you can find the example usage for android.widget AdapterView setOnItemLongClickListener.

Prototype

public void setOnItemLongClickListener(OnItemLongClickListener listener) 

Source Link

Document

Register a callback to be invoked when an item in this AdapterView has been clicked and held

Usage

From source file:com.androidquery.AbstractAQuery.java

/**
 * Register a callback method for when an item is long clicked in the ListView.
 *
 * @param listener The callback method.//from  w  w w .java 2  s  . com
 * @return self
 */
public T itemLongClicked(OnItemLongClickListener listener) {

    if (view instanceof AdapterView) {

        AdapterView<?> alv = (AdapterView<?>) view;
        alv.setOnItemLongClickListener(listener);

    }

    return self();

}