0

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

Community
  • 1
  • 1
SwANDp
  • 59
  • 9
  • You can do it via array adapter filter. – ilango j Apr 01 '13 at 13:53
  • do I need to call performFiltering method manually?? I tried it as well my 2nd link bt not worked – SwANDp Apr 02 '13 at 05:42
  • No not in the text watcher. Try in filter in arrray adapter. Refer this for use of filter http://stackoverflow.com/questions/10050108/android-autocompletetextview-using-arrayadapter-and-filter – ilango j Apr 02 '13 at 05:51
  • Hi llango, I solved the problem by customizing my AutocompleteTextView refered this: https://groups.google.com/forum/?fromgroups=#!topic/android-developers/OrsN2xRpDmA In my case performFiltering(CharSequence constraint) method was not getting called but will try it out once more – SwANDp Apr 02 '13 at 12:49

0 Answers0