1. You want that $100.00 in your pocket or an Amazon Fire TV don't you? Well here's the deal. With our new updated look we are in desperate need of an updated logo. The 'old' one has certainly served us well, but it's time. Find all the details here: bit.ly/1q0k6Wa
  2. DroidForums.net is currently undergoing a major software upgrade. If you are experiencing any problems logging in please: Contact Us

Force close Need help

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

  1. Bigmos
    Offline

    Bigmos New Member

    Joined:
    Feb 9, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    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
    Offline

    Bigmos New Member

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