Android Studio EditText Entergedrückte

EditText edittext = (EditText) findViewById(R.id.youredittext);
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) {
    if (s.toString().contains("\n")) {
      //Action here
    }
  }
});
Concerned Centipede