editText.addTextChangedListener(new TextWatcher(){

   public void afterTextChanged(Editable s) {
    // TODO Auto-generated method stub
    //s:变化后的所有字符
    Toast.makeText(getApplicationContext(), "变化:"+s, Toast.LENGTH_SHORT).show();
   }

   public void beforeTextChanged(CharSequence s, int start, int count,
     int after) {
    // TODO Auto-generated method stub
    //s:变化前的所有字符; start:字符开始的位置; count:变化前的总字节数;after:变化后的字节数
    Toast.makeText(getApplicationContext(), "变化前:"+s+";"+start+";"+count+";"+after, Toast.LENGTH_SHORT).show();
   }

   public void onTextChanged(CharSequence s, int start, int before,
     int count) {
    // TODO Auto-generated method stub
    //S:变化后的所有字符;start:字符起始的位置;before: 变化之前的总字节数;count:变化后的字节数
    Toast.makeText(getApplicationContext(), "变化后:"+s+";"+start+";"+before+";"+count, Toast.LENGTH_SHORT).show();
   }
});

相关文章:

  • 2021-11-26
  • 2021-08-22
  • 2021-09-09
  • 2021-07-30
  • 2022-12-23
  • 2022-01-16
  • 2022-12-23
  • 2022-02-21
猜你喜欢
  • 2021-07-23
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-03-02
  • 2022-12-23
相关资源
相似解决方案