The task is that when the first editText changes, the 2nd one changes, and when the 2nd changes, the first one.
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); etNum2 = (EditText) findViewById(R.id.editText2); etNum = (EditText) findViewById(R.id.editText); etNum.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { if(s.toString().length()>0){ h.removeCallbacksAndMessages(null); // Cancels previous call h.postDelayed(new Runnable() { @Override public void run() { num1 = Float.parseFloat(etNum.getText().toString()); vivod = ((1/Float.parseFloat(r))*Float.parseFloat(k))*num1; String str = String.valueOf(vivod); etNum2.setText(str); } }, 10); // 1 second } else{ } } }); So far I have succeeded in doing this only if I try to change the second, it’s just zero in both of them and they cannot be changed in any way. I tried to create a new listner, nothing happened, I hope someone will tell me. thank