如何捕捉AutoCompleteTextView的箭头点击事件
How to capture the AutoCompleteTextView arrow click event
我如何捕捉点击AutoCompleteTextView
箭头。
OnClick
适用于组件的其余部分,但当您专门单击箭头时它不起作用。
花了一些时间,但我找到了解决方案。
该事件在 AutoCompleteTextView 的父级中。
XML:
XML
解决方案:
public com.google.android.material.textfield.TextInputLayout txtGleba;
...
txtGleba = findViewById(R.id.txtGleba);
txtGleba.setEndIconOnClickListener (new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
我如何捕捉点击AutoCompleteTextView
箭头。
OnClick
适用于组件的其余部分,但当您专门单击箭头时它不起作用。
花了一些时间,但我找到了解决方案。
该事件在 AutoCompleteTextView 的父级中。
XML:
XML
解决方案:
public com.google.android.material.textfield.TextInputLayout txtGleba;
...
txtGleba = findViewById(R.id.txtGleba);
txtGleba.setEndIconOnClickListener (new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});