Force close Need help

Discussion in 'Android Hacks and Help' started by Bigmos, Feb 11, 2011.

  1. Bigmos

    Bigmos New Member

    Joined:
    Feb 9, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Here is my code why on button 2 it forces closes

    public class qtmmobile extends Activity {
    /** private String currentSponsorUrl;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    }

    /**
    * Create a browser Intent and go to the URI of the displayed
    * sponsor.
    */
    public void clickAdButtonHandler( View view )
    {
    if( view.getId() != R.id.button1 )
    return;

    String url = "http://www.mysite.com/" ;

    if( url != null )

    {
    Intent intent = new Intent( Intent.ACTION_VIEW );
    intent.setData( Uri.parse( url ) );
    startActivity( intent );
    }
    }
    public void clickAdButtonHandler1( View view )
    {
    if( view.getId() != R.id.button2 )
    return;
    String url ="//google.com" ;

    if( url != null )

    {
    Intent intent = new Intent( Intent.ACTION_VIEW );
    intent.setData( Uri.parse( url ) );
    startActivity( intent );

    }





    }
    }
     
    Last edited: Feb 11, 2011
  2. Bigmos

    Bigmos New Member

    Joined:
    Feb 9, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    I got it i had a type-o