Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f85f081d authored by Dianne Hackborn's avatar Dianne Hackborn Committed by The Android Open Source Project
Browse files

Automated import from //branches/master/...@141727,141727

parent effd8d55
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
@@ -922,6 +923,20 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
        }
    };

    @Override
    public void cancel() {
        // We made sure the IME was displayed, so also make sure it is closed
        // when we go away.
        InputMethodManager imm = (InputMethodManager)getContext()
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        if (imm != null) {
            imm.hideSoftInputFromWindow(
                    getWindow().getDecorView().getWindowToken(), 0);
        }
        
        super.cancel();
    }
    
    /**
     * Various ways to launch searches
     */