using two observes to update one EditText

25 views Asked by At

i have this EditText:

binding.creditAndCash.setText(" cash: " + cash + "₪" + " cerdit: " + getInputOne + "₪");

with two parms: cash and getInputOne. in the Acticity i have the observes:

        viewModel.getCash().observe(this, new Observer<Double>() {
            @Override
            public void onChanged(Double aDouble) {
                binding.creditAndCash.setText(" cash: " + cash + "₪" + " cerdit: " + getInputOne + "₪");

            }
        });
        viewModel.getCredit().observe(this, new Observer<Double>() {
            @Override
            public void onChanged(Double aDouble) {
                binding.creditAndCash.setText(" cash: " + cash + "₪" + " cerdit: " + getInputOne + "₪");

            }
        });

the problem is how to update to prams with only one EditText, is it posible? `

i want to setText with the updates parms i have. the parms as i said is cash and getInputOne..

0

There are 0 answers