I have some data in in arrayList allDoctorsAndSpecialities.
In my Oncreate method I have set adapter and threshold(3) for my autotxt(AutoCompleteTextView)
However,My problem is I don't want to show dropdown for strings entered in edittext like "dr.","dr. ",etc.
Following are solutions I tried
1) code:
autotxt.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
// TODO Auto-generated method stub
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
if(autotxt.getText().toString().equals("dr.")){
autotxt.dismissDropDown();
}
}
});
Problem- It does not work combination like 'Docname DocSurname'
2)AutoCompleteTextView filter problem
problem-It did not work for my problem
3)How do I use publishResults() method when extending Filters in Android?
problem-I dont understand how to set constraint for performFiltering method
Please suggest me how to proceed. Thanks in advance