我試圖讓我的一個項目點擊程序響應,這我的代碼的Android的ListView onItemClickListener錯誤
list.getOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(NumbersActivity.this, "", Toast.LENGTH_SHORT).show();
}
});
,但我得到這個錯誤
Error:(43, 13) error: method getOnItemClickListener in class AdapterView cannot be applied to given types; required: no arguments found: reason: actual and formal argument lists differ in length where T is a type-variable: T extends Adapter declared in class AdapterView
你需要設置它,而不是得到。 –