Example usage for android.widget AdapterView setOnItemSelectedListener

List of usage examples for android.widget AdapterView setOnItemSelectedListener

Introduction

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

Prototype

public void setOnItemSelectedListener(@Nullable OnItemSelectedListener listener) 

Source Link

Document

Register a callback to be invoked when an item in this AdapterView has been selected.

Usage

From source file:com.benefit.buy.library.http.query.AbstractAQuery.java

/**
 * Register a callback method for when an item is selected.
 * @param listener The item selected listener.
 * @return self/*from www .  jav a2  s. c  o m*/
 */
public T itemSelected(OnItemSelectedListener listener) {
    if (view instanceof AdapterView) {
        AdapterView<?> alv = (AdapterView<?>) view;
        alv.setOnItemSelectedListener(listener);
    }
    return self();
}

From source file:com.androidquery.AQuery.java

/**
 * Register a callback method for when an item is selected. 
 *
 * @param listener The item selected listener.
 * @return self/*from  ww w . j  a v  a 2  s .  c  o  m*/
 */
public AQuery itemSelected(OnItemSelectedListener listener) {

    if (view instanceof AdapterView) {
        AdapterView<?> alv = (AdapterView<?>) view;
        alv.setOnItemSelectedListener(listener);
    }

    return self();

}

From source file:com.androidquery.AbstractAQuery.java

/**
 * Register a callback method for when an item is selected. 
 *
 * @param listener The item selected listener.
 * @return self//from  www  .  j  a v  a 2 s  .  c  o  m
 */
public T itemSelected(OnItemSelectedListener listener) {

    if (view instanceof AdapterView) {
        AdapterView<?> alv = (AdapterView<?>) view;
        alv.setOnItemSelectedListener(listener);
    }

    return self();

}