当 MultiAutoCompleteTextView 被点击并获得焦点时需要做一些事情,但似乎没有调用侦听器。知道为什么吗?这是代码:
searchbar.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean b) {
if(b) hide();
else Utils.closeKeyboard(MapsActivity_v2.this, view);
}
});
<MultiAutoCompleteTextView
android:imeOptions="actionDone"
android:id="@+id/searchbar"
android:focusable="true"
android:focusableInTouchMode="true"
android:background="@android:color/transparent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint="@string/search_hint"
android:padding="6dp"/>