在Button的点击事件方法onClick中添加如下代码
@Override public void onClick(View v) { Intent intent = new Intent(getApplicationContext(), SecondActivity.class); startActivity(intent); }
new Intent()中第一个参数是上下文,第二个是类名.class
在Button的点击事件方法onClick中添加如下代码
@Override public void onClick(View v) { Intent intent = new Intent(getApplicationContext(), SecondActivity.class); startActivity(intent); }
new Intent()中第一个参数是上下文,第二个是类名.class