上午在Android的程序基本上想提出在當我點擊 按鈕上的文本不會改變應用程序的新...這裏是我的代碼..Button.OnClickListener()給出了錯誤
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button HimanshuButton = (Button) findViewById(R.id.HimanshuButton);
HimanshuButton.setOnClickListener(
new Button.OnClickListener() {
public void OnClick(View v){
TextView HimanshuText = (TextView)findViewById(R.id.HimanshuText);
HimanshuText.setText("Great Himanshu Rahi");
在此 Button.OnClickListener給我的錯誤,如線下紅..
它的View.OnClickListener(任何視圖可以有一個點擊監聽器,不只是按鈕)。 –