Debugging app (Force Close) "Thread exiting due uncaught exception"-Android
<p>Im new to Java so, i think in order to prevent this error from appearing i have to write a handlerthread? Using try and Catch? How do i do this? Here's the code to help you out.  Thanks :)</p>

<pre><code>package android.app;
import android.app.Activity;
import android.app.R;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;



public class AndroidActivity extends Activity{

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

        Button next = (Button) findViewById(R.id.Start_CoolWhapp);
        next.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent myIntent = new Intent(view.getContext(), activity2.class);
                startActivityForResult(myIntent, 0);
            }

        });
    }
}
</code></pre>
