/*
* 第一个跳转代码
*/
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent();
intent.setClass(MainActivity.this, SecondActivityActivity.class);
startActivity(intent);
MainActivity.this.finish();
}
});
//第二种跳转
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent =new Intent(MainActivity.this, SecondActivityActivity.class);
intent.putExtra("MainActivity", "from MainActivity");
startActivityForResult(intent, REQUEST_CODE);
}
});