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)
还有没实现的方法。