title: How can I set the focus (and display the keyboard) on my EditText programmatically
body: <p>I have a layout which contains some views like this:</p>
  
  <pre><code>&lt;LinearLayout&gt;
  &lt;TextView...&gt;
  &lt;TextView...&gt;
  &lt;ImageView ...&gt;
  &lt;EditText...&gt;
  &lt;Button...&gt;
  &lt;/linearLayout&gt;
  </code></pre>
  
  <p>How can I set the focus (display the keyboard) on my <code>EditText</code> programmatically?</p>
  
  <p>I've tried this and it works only when I launch my <code>Activity</code> normally, but when I launch it in a <code>TabHost</code>, it doesn't work.</p>
  
  <pre><code>txtSearch.setFocusableInTouchMode(true);
  txtSearch.setFocusable(true);
  txtSearch.requestFocus();
  </code></pre>