一个按钮可以切换,两个按钮切换两个不同页面应该怎么写呢?点击button4,从TwoActivity跳到FourActivity
package com.example.ricky.myapplication;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class TwoActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.two);
Button btn3=(Button)findViewById(R.id.button3);
btn3.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View V){
Intent intent=new Intent(TwoActivity.this,ThreeActivity.class);
startActivity(intent);
}
});
}
}