Omar Abdelhafiz Omar Abdelhafiz - 5 months ago 9
Android Question

I want to make something when done from typing EditText

what is the method I should use to type what will happen after being finished from typing in the EditText?

Please use simple statements and use an example with comments of what happens in that line and what to type in that line.

PS

I wish you got the lines above!!!

Answer

you need to add a text watcher to the text view

Example:

    myEditText.addTextChangedListener(new TextWatcher() {

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

            // Your query to fetch Data
        }

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {

        }

        @Override
        public void afterTextChanged(Editable s) {
            // Your logic here
        }
    });
Comments