Starting a browser from a textbox via Intent - Is http:// required?
<p>I have the following code:</p>

<pre><code>    /** Open a browser on the URL specified in the text box */
private void openBrowser() {
    Uri uri = Uri.parse(urlText.getText().toString());
    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
    startActivity(intent);
}
</code></pre>

<p>When I input "http://www.google.com" to the textbox, it works fine. However, when I try something like "www.google.com" it crashes with:</p>

<blockquote>
  <p>No Activity found to handle Intent {
  act=android.intent.action.VIEW
  dat=www.google.com }</p>
</blockquote>

<p>Am I using Uri wrong? Is there a way to extract full address from it? Or am I supposed to write code that adds http manually? e.g, if not starts with http://, add http://.</p>

<p>Thanks!</p>
