@override annotation in eclipse

Viewed 802

I know there are many people asking the same question (and many answering it), but none of their answers are helping me.

I always get @override annotation errors if I'm anonymously implementing a method from an interface.

 listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override //  <-- **this will give error message**
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {

            Menu menu = MainMenu.listMenu.get(i);


            Tabs.setCurrentTab(menu.pos + 1); 
        }
    });

I am developing my android application in a team. My team are using IDEA whilst I am using eclipse. My team never get this error. Could it be eclipse's bug?

Our java version is the same, 1.6. My eclipse version is 3.7.

The error is :

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 anyone suggest someting that could be done to remove this error?

EDIT : more information, i would not get 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;
    }
1 Answers
Related