I am having a problem when I press my button to store my EditText info to a string the app crashes and I can't find any problem's, am I setting something up wrong and I just don't see it?
public class Tab5 extends Activity {
Button btnGo ;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tab5);
btnGo = (Button) findViewById(R.id.button1);
btnGo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
EditText userid = (EditText) findViewById(R.id.editText1);
userid.setText(2);
Intent intent = new Intent(Tab5.this, Tab1.class);
userid.getText().toString();
startActivity(intent);
}
});
}
}