Android: Starting Web Browser From Code
<p>I am trying to open a web browser with a supplied url, however, after the last line of the following code, I get a null pointer exception.  According to the call stack,  <code>Actvity.startActvitity(Intent)</code> is where the exception occurs.  This code is in a custom controller  class for a sub view of the main activity.  Any ideas on how to properly start the web browser via code, ideally from outside the main activity since I would to reuse as much as possible.  or at least point me in the right direction. </p>

<pre><code>private void showWebSite() {
            String _url = (String) this.urlview.getText();
            Activity webactivity = new Activity();
            Intent webIntent = new Intent( Intent.ACTION_VIEW );
            webIntent.setData( Uri.parse(_url) );
            webactivity.startActivity( webIntent );
    }
</code></pre>
