title: Android - Multiline EditText wothout auto line break
body: <p>I need to implement an EditText which allows text more than the screen size as in:</p>
  
  <pre><code>android:inputType="textLongMessage"
  </code></pre>
  
  <p>But also supports the Enter key as in:</p>
  
  <pre><code>android:inputType="textMultiLine"
  </code></pre>
  
  <p>Tried overriding dispatchKeyEvent but still unable to fix this.</p>
  
  <pre><code>&lt;EditText
          android:id="@+id/basicBatEdittext"
          android:layout_width="fill_parent"
          android:layout_height="0dp"
          android:layout_weight="3"
          android:background="#000"
          android:gravity="top"
          android:scrollHorizontally="true"
          android:hint="Hey there!\nHow is it going?"
          android:inputType="textLongMessage"
          android:padding="6dp"
          android:textColor="#fff"
          android:textColorHint="#fff"
          android:textCursorDrawable="@null" /&gt;
  
  
      @Override
  public boolean dispatchKeyEvent(KeyEvent event) {
  
      if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER || event.getKeyCode() == KeyEvent.ACTION_DOWN || event.getKeyCode() == KeyEvent.KEYCODE_NAVIGATE_NEXT) {
  
          String temp = edittext.getText().toString() + "\n";
          edittext.setText(temp);
  
              return true;
          }
  
      return super.dispatchKeyEvent(event);
  };
  </code></pre>
  
  <p>It just appends two blank spaces to the EditText.</p>