title: Android EditText not showing keyboard
body: <p>I have just started programming on Android and have completed the MyFirstApp tutorial:</p>
  <p><a href="http://developer.android.com/training/basics/firstapp/building-ui.html" rel="nofollow noreferrer">http://developer.android.com/training/basics/firstapp/building-ui.html</a></p>
  <p>The app runs, however when I touch the text field, the soft keyboard does not popup.</p>
  <pre><code>&lt;EditText
      android:id=&quot;@+id/edit_message&quot;
      android:layout_weight=&quot;1&quot;
      android:layout_width=&quot;0dp&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:hint=&quot;@string/edit_message&quot;
      android:focusable=&quot;true&quot;
      android:focusableInTouchMode=&quot;true&quot; 
      &gt;
  &lt;/EditText&gt;
  </code></pre>
  <p>I have tried adding:</p>
  <pre><code>  &lt;requestFocus /&gt;
  </code></pre>
  <p>but that makes no difference.</p>
  <p>I have added this to the mainifest, but that also makes no difference:</p>
  <pre><code>android:windowSoftInputMode=&quot;stateAlwaysVisible&quot;
  </code></pre>
  <p>Surely this kind of functionality is already built in and I don't have to create a custom function (method) to achieve this ? - I would have expected the tutorial to at least mention that the keyboard won't popup using the provided code, as I have spent the last 3 hours trying to figure out what was wrong with my code !</p>
  <h2>EDIT</h2>
  <p>I am working on the latest 4.42 and have added the clearFocus() however that makes no difference:</p>
  <pre><code>public void sendMessage(View view) {
      Intent intent = new Intent(this, DisplayMessageActivity.class);
      EditText editText = (EditText) findViewById(R.id.edit_message);
      
      editText.clearFocus();
      String message = editText.getText().toString();
      intent.putExtra(EXTRA_MESSAGE, message);
      startActivity(intent);
  
  } 
  </code></pre>