0

I want to make an intelligent search as in mobile contact search in android.

e.g: When the user starts input in search box, after typing one alphabet, as a result, it should display all the data starting from the alphabet that was input.

0

3 Answers 3

1
EditText searchTo = (EditText)findViewById(R.id.medittext);
searchTo.addTextChangedListener(new TextWatcher() {

    @Override
    public void afterTextChanged(Editable s) {
        // TODO Auto-generated method stub

//here you check for your conditions...

    }

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {

        doSomething();



    } 

});
Sign up to request clarification or add additional context in comments.

Comments

1

You need to look into the AutoCompleteTextView provided by Android

Comments

0

You have two options

  1. use AutoCompleteTextView

  2. use textwatcher for EditText

check Buttons on List View with easy searching in Android

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.