How to use EditText onTextChanged event when I press the number?

前端 未结 6 589
自闭症患者
自闭症患者 2020-11-30 06:40

I have an EditText with \"text = 0.00\". When I press the number 3, it should be like 0.03 and the second time when I press the number

6条回答
  •  佛祖请我去吃肉
    2020-11-30 07:07

    To change the text;

    multipleLine.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) {
                MainActivity.myArray.set(pickId,String.valueOf(s));
                MainActivity.myAdapt.notifyDataSetChanged();
            }
    
            @Override
            public void afterTextChanged(Editable s) {
    
            }
    

提交回复
热议问题