Android Q&A | setOnItemClickListener(AdapterView.OnItemClickListener) in the type AdapterView....

Question:

The method setOnItemClickListener(AdapterView.OnItemClickListener) in the type AdapterView is not applicable for the arguments (new OnItemClickListener(){})



Answer:

提示内容:需要的是AdapterView.OnItemClickListener,而你提供的不是。

鼠标放到OnItemClickListener上,就会明白其实它是另一种view的OnItemClickListener。

所以为了避免混淆直接写new AdapterView.OnItemClickListener(){...},并导入android.widget.AdapterView


你可能感兴趣的:(Android)