android edittext monitor text changed

w‮uttual.ww‬ri.com
android edittext monitor text changed
EditText edittext = (EditText) findViewById(R.id.yourEdittextID);
edittext.addTextChangedListener(new TextWatcher() {
  public void afterTextChanged(Editable s) { }
  public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
  public void onTextChanged(CharSequence s, int start, int before, int count) {
  	// the text in edittext is changed.
	
    if (s.toString().contains("\n")) {
      
    }
  }
});
Created Time:2017-08-31 16:07:29  Author:lautturi