通常的Button监听都是通过实例化Button(findviewby…)
然后.setOnClickListener()
现在用
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:onClick="cc"/>
在Activity里
public void cc(View v) {
Intent i = new Intent(MainActivity.this,Main2Activity.class);
startActivity(i);
}
就可以通过新方法设置监听