Android Application is unexpectedly stopped error when button is clicked
Posted
by
user1794499
on Stack Overflow
See other posts from Stack Overflow
or by user1794499
Published on 2012-11-03T03:10:46Z
Indexed on
2012/11/03
5:01 UTC
Read the original article
Hit count: 435
Hi there I'm totally new to Android development and I'm working in my android application my application includes a forum where users can post, comment and have their discussion there.... So I'm working in the interface but I get error when I click on the button I directs me to the signup page can somebody please help me with this error
this is the code of the mainuserinterface.java for the mainuserinterface.xml file where the button resides. and the signupform.class is the java file for the next activity triggered when the button is clicked
the error I receive is the application is unexpectedly stopped.. Hope I make it clear for you guys
package com.mohammed.watzIslam;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class mainuserinterface extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.mainuserinterface);
// this is the button where I receive errors when I click
Button forum = (Button) findViewById(R.id.next);
forum.setOnClickListener(new View.OnClickListener() {
public void onClick(View view){
Intent myIntent = new Intent (view.getContext(), signupform.class);
startActivityForResult (myIntent, 0);
}
});
//these two button still not directing to any next activity yet
Button button1 = (Button) findViewById(R.id.next);
forum.setOnClickListener(new View.OnClickListener() {
public void onClick(View view){
Intent myIntent1 = new Intent (view.getContext(), signupform.class);
startActivityForResult (myIntent1, 0);
}
});
Button button2 = (Button) findViewById(R.id.next);
forum.setOnClickListener(new View.OnClickListener() {
public void onClick(View view){
Intent myIntent2 = new Intent (view.getContext(), signupform.class);
startActivityForResult (myIntent2, 0);
}
});
}
}
© Stack Overflow or respective owner