我找不到解決方案,我的問題!我不斷收到錯誤:onClickListener問題找不到解決方案
onClickListener cannot be resolved to a type
請幫忙!!這裏是我的代碼
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.Button;
import android.view.View;
import android.view.View.OnClickListener;
public class MainActivity extends Activity implements onClickListener{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button send = (Button) findViewById(R.id.button1);
send.setOnClickListener(this);
}
@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;
}
您是否嘗試在OnClickListener中大寫'O'? – JRowan
自從我做了任何Java之後已經過去了幾個月,但沒有實現意味着您將在此類中提供該功能。即你說你實現它,但我沒有看到它在這裏 – nPn