Noha Nhe
Noha Nhe

Reputation: 235

android change setText

I'm developing an android application.. I want to set a text in an editText based on the user's entered keys from softkeyboard.

How can I change the text content before it is set in the EditText in android application???

Upvotes: 0

Views: 197

Answers (2)

Mehul Santoki
Mehul Santoki

Reputation: 1208

This may help you.

editText.addTextChangedListener(new TextWatcher() {
    public void onTextChanged(CharSequence s, int start, int before, int count) {
    }

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

    public void afterTextChanged(Editable s) {
    }
});

Upvotes: 1

sdabet
sdabet

Reputation: 18670

With TextView.setOnEditorActionListener() you can be notified when an action is performed in the EditText.

Upvotes: 2

Related Questions