这是我的代码,我需要在里面放一些东西{} 以将按钮链接到新类或活动,例如 second page.java :
public void addListenerOnButton() {
ImageButton imageButton = (ImageButton) findViewById(R.id.imageButton1);
imageButton.setOnClickListener(new OnClickListener() {
/*What can I put here to open new class
,I mean another activity like secondp.java.*/
}
我试图把下面的代码,但我得到了以下错误:
The constructor Intent(new View.OnClickListener(){}, Class<List>) is undefined
代码
@Override
public void onClick(View arg0) {
Intent k = new Intent(this,Secondp.class);
startActivity(k);