4

我在从其他开发人员发送给我的程序中遇到错误。在 Eclipse 中,我收到错误提示“此行的多个标记...必须覆盖超类方法”。“快速修复”建议是删除 @override 命令,但一旦我这样做,我就会得到同样的错误。您可以在www.theiatech.com/Mark/Eclipse_error.jpg看到错误图片。

我该怎么做才能消除错误以便编译程序?

我正在使用 Eclipse Classic 3.7.1、Java 合规级别 1.6、JRE6、Android 1.6 库

4

2 回答 2

1

Multiple markers means that there is more than one error, breakpoint, TODO, etc. at a particular line. Even if you remove all of the errors, there could still be "multiple markers". That said, frequently a single bug in the code will cause a compiler/interpreter to report multiple errors. Start at the first reported error, find the cause and fix it. This will often remove more than one error. Repeat the "debugging" process until all errors are gone.

I would not just remove the @override. Find out why it is there. You are likely to understand the error then.

Good luck and happy coding!

于 2011-11-17T00:10:29.480 回答
1

尝试使用 new AdapterView.OnItemSelectedListener() 代替 Spinner.OnItemSelectedListener()

sp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {

            public void onItemSelected(AdapterView<?> arg0, View arg1,
                    int arg2, long arg3) {

            }

            public void onNothingSelected(AdapterView<?> arg0) {

            }
        });
于 2011-11-17T06:16:26.173 回答