首页 新闻 会员 周边

安卓编程错误must implement the inherited abstract method AdapterView.

0
悬赏园豆:30 [待解决问题]

menuList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View itemClicked, int position, long id) {

// Note: if the list was built "by hand" the id could be used.
// As-is, though, each item has the same id

TextView textView = (TextView) itemClicked;
String strText = textView.getText().toString();

if (strText.equalsIgnoreCase(getResources().getString(R.string.menu_item_play))) {
// Launch the Game Activity
startActivity(new Intent(QuizMenuActivity.this, QuizGameActivity.class));
} else if (strText.equalsIgnoreCase(getResources().getString(R.string.menu_item_help))) {
// Launch the Help Activity
startActivity(new Intent(QuizMenuActivity.this, QuizHelpActivity.class));
} else if (strText.equalsIgnoreCase(getResources().getString(R.string.menu_item_settings))) {
// Launch the Settings Activity
startActivity(new Intent(QuizMenuActivity.this, QuizSettingsActivity.class));
} else if (strText.equalsIgnoreCase(getResources().getString(R.string.menu_item_scores))) {
// Launch the Scores Activity
startActivity(new Intent(QuizMenuActivity.this, QuizScoresActivity.class));
}

}
});

第一个语句发生错误

The type new AdapterView.OnItemClickListener(){} must implement the inherited abstract method AdapterView.OnItemClickListener.onItemClick(AdapterView<?>, View, int, long)

10-叶宝安的主页 10-叶宝安 | 初学一级 | 园豆:172
提问于:2015-09-23 17:20
< >
分享
所有回答(1)
0

还有没实现的方法。

JackWang-CUMT | 园豆:2866 (老鸟四级) | 2015-09-24 05:05
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册