title: setOnEditorActionListener not working with soft keyboard submit button, but does with laptop Enter key?
body: <p>Can someone please provide a solution to get a working listener for the soft-keyboard <code>DONE</code> button, and/or explain what I'm doing wrong in my current approach?</p>
  
  <p>My Xml &amp; Java Setup</p>
  
  <ul>
  <li>In Xml, there's a simple EditText is set with <code>android:imeOptions="actionDone"</code> </li>
  <li>In Java, it just has a basic <code>TextView.OnEditorActionListener</code> declared</li>
  </ul>
  
  <p>So <code>setOnEditorActionListener()</code> is not getting called when there is a click from device soft-keyboard submit (aka <code>DONE</code>) button - the green arrow button below ; <em>only the EditText field is cleared</em></p>
  
  <p><a href="https://i.stack.imgur.com/2Jqsu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2Jqsu.png" alt="enter image description here"></a></p>
  
  <p>But that listener DOES get called when clicking the computer <code>Enter</code> key <em>(attached via ADB)</em>.</p>
  
  <p>I would figure it should work for both those buttons .. is this not right?</p>
  
  <p><strong>XML Layout File:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/activity_main"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      tools:context="com.demo.MainActivity"&gt;
  
      &lt;EditText
          android:id="@+id/comment_text"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="center_vertical"
          android:maxLines="1"
          android:imeOptions="actionDone"
          /&gt;    
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>Java Activity File:</strong></p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          ((EditText) findViewById(R.id.comment_text)).setOnEditorActionListener(new TextView.OnEditorActionListener() {
              @Override
              public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                  int i = 5; // added this to set a break point
                  return false;
              }
          });
      }
  }
  </code></pre>
  
  <blockquote>
    <p><strong>Update for Solution</strong></p>
    
    <p>Thanks to @Apoorv Mehrotra's answer, it turns out that my EditText was missing this one attribute in order for the soft keyboard event to be recognized.  Adding this to the above Xml solves the problem.</p>
    
    <p><code>android:inputType="text"</code></p>
  </blockquote>