我是 Android 编程领域的初学者。我只是想开发一个示例应用程序。这是项目:
public class CalcActivity extends Activity implements OnClickListener{
EditText input = (EditText) findViewById(R.id.input);
Button one = (Button) findViewById(R.id.button1);
TextView out = (TextView) findViewById(R.id.output);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_calc);
//one.setOnClickListener(this);
}
public void onClick(View v){
input.setText("HI");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.calc, menu);
return true;
}
}