I know that many people ask the same question (and many answer it), but none of their answers help me.
I always get @override annotation errors if I anonymously implement a method from the interface.
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override
I am developing an Android application as a team. My team uses IDEA while I use eclipse. My team never gets this error. Could this be an eclipse mistake?
Our java version is the same, 1.6. My eclipse version is 3.7.
Error:
Multiple markers at this line - The method onItemClick(AdapterView<?>, View, int, long) of type new AdapterView.OnItemClickListener(){} must override a superclass method - implements android.widget.AdapterView.OnItemClickListener.onItemClick
Can someone suggest something that could be done to remove this error?
EDIT: more information, I would not get an error in this case:
@Override public View getView(int position, View v, ViewGroup parent) { try { ... } Menu menu = Menu.getListMenu().get(position); if (menu != null){ ... } } catch (Exception e) { ... } return v; }
source share