JAVA - Android error: The application has stopped unexpectedly please try again
<p>I made an app which is just working fine. But when i click on "cancel" or "ok" button when i run the program, instead of linking me to result.java, the simulator give me "The application has stopped unexpectedly please try again" Here's the code</p>

<pre><code>import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.database.CursorJoiner.Result;
import android.os.Bundle;
import android.view.View;
import android.widget.AutoCompleteTextView;

public class lib_main extends Activity {

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
public void onAddClick (View botton){

AutoCompleteTextView title = (AutoCompleteTextView)findViewById(R.id.Title);
AutoCompleteTextView author = (AutoCompleteTextView)findViewById(R.id.Author); 
AutoCompleteTextView isbn = (AutoCompleteTextView)findViewById(R.id.ISBN);

Intent intent = new Intent();
intent.setClass(this,Result.class);

intent.putExtra("Title", title.getText().toString());
intent.putExtra("Author", author.getText().toString()); 
intent.putExtra("ISBN", isbn.getText().toString());
startActivity(intent);
}

public void onCancelClick(View botton){



Intent intent = new Intent();
intent.setComponent(new ComponentName(this,Result.class));

intent.putExtra("Cancel","Cancel");
startActivity(intent);
}

}
</code></pre>

<p>this is Result.java</p>

<pre><code>import android.app.Activity; 
import android.os.Bundle; 
import android.widget.TextView;

public class Result extends Activity {

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.result);

TextView resultText=(TextView)findViewById(R.id.resultText);

Bundle bundle =getIntent().getExtras();
if(bundle.getString("Cancel")!= null)
{resultText.setText("operation cancel");}
else
{  String book =bundle.getString ("Title");
   String title =bundle.getString ("Author");
   String isbn =bundle.getString ("ISBN");
   resultText.setText(
     getString (R.string.resultOk)+""+book+""+ title+""+isbn);


 }
 }
 }
</code></pre>

<p>the error log write "No command output when running:'am start-n com.Library.doc/com.Library.doc.lib_main-a android.intent.action.MAIN-c android.intent.category.LAUNCHER' in device emulator-5554"</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.Library.doc"
  android:versionCode="1"
  android:versionName="1.0"&gt;
&lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
    &lt;activity android:name=".lib_main"
              android:label="@string/app_name"&gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.MAIN" /&gt;
            &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
        &lt;/intent-filter&gt;
    &lt;/activity&gt;
  &lt;activity android:name=".Result"
              android:label="@string/result"&gt;

    &lt;/activity&gt;
&lt;/application&gt;
&lt;uses-sdk android:minSdkVersion="8" /&gt;
</code></pre>

<p> 
Can anyone help me with this problem?</p>
