这是我的代码,Eclipse 说
Multiple markers at this line
- Syntax error on token(s), misplaced construct(s)
- Syntax error on token "OnClickListener", = expected after this token
我不确定我应该怎么做,谢谢
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.view.View.OnClickListener;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
Button btn = (Button) findViewById(R.id.btn);
btn.OnClickListener (new OnClickListener()
);
public void onClick(View arg0)
{
}
;
}