How to use addTextChangedListener to change values of other TextViews

At times, the value of one TextView is to be replicated into others as a user types the text. Below illustrates how that can be done. In class MainActivity, variable has been declared for the class as below:

TextInputEditText[] array_yourinterest_rate = new TextInputEditText[12];

Within the onCreate method of MainActivity, addTextChangedListener was added to change the values of the views in array_yourinterest_rate as the value of bindMainly.activityMainMyInterest changes as the user types.

Below is the code segment to illustrate how that was done.

bindMainly.activityMainMyInterest.addTextChangedListener(new TextWatcher() {
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {


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


        public void afterTextChanged(Editable s) {
            for (int i = 0; i < 12; i++) {

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s