Example usage for android.widget AutoCompleteTextView dismissDropDown

List of usage examples for android.widget AutoCompleteTextView dismissDropDown

Introduction

In this page you can find the example usage for android.widget AutoCompleteTextView dismissDropDown.

Prototype

public void dismissDropDown() 

Source Link

Document

Closes the drop down if present on screen.

Usage

From source file:de.grobox.liberario.StationsFragment.java

private void setStation(Location station) {
    AutoCompleteTextView stationView = (AutoCompleteTextView) mView.findViewById(R.id.stationView);
    ImageButton stationClearButton = (ImageButton) mView.findViewById(R.id.stationClearButton);

    if (station != null) {
        stationView.setText(station.uniqueShortName());
        stationView.setTag(station);/*from w  ww  .  j  av  a 2s  .c  o  m*/
        stationClearButton.setVisibility(View.VISIBLE);
    } else {
        stationView.setText("");
        stationView.setTag(null);
        stationClearButton.setVisibility(View.GONE);
    }
    stationView.dismissDropDown();
}

From source file:de.grobox.liberario.DirectionsFragment.java

private void setLocation(Location loc, FavLocation.LOC_TYPE loc_type, Drawable icon, boolean setText) {
    if (!mChange) {
        mChange = true;/*from  ww w  .  j a v a  2s .co m*/
        final ImageView statusButton;
        AutoCompleteTextView textView;

        if (loc_type.equals(FavLocation.LOC_TYPE.FROM)) {
            statusButton = (ImageView) mView.findViewById(R.id.fromStatusButton);
            textView = (AutoCompleteTextView) mView.findViewById(R.id.from);
        } else {
            statusButton = (ImageView) mView.findViewById(R.id.toStatusButton);
            textView = (AutoCompleteTextView) mView.findViewById(R.id.to);
        }

        textView.setTag(loc);

        if (loc != null) {
            if (setText)
                textView.setText(loc.uniqueShortName());
        } else {
            if (setText)
                textView.setText(null);
        }

        statusButton.setImageDrawable(icon);
        textView.dismissDropDown();

        mChange = false;
    }
}