@Override annotation error (android prefs)

牧云@^-^@ 提交于 2019-11-27 08:38:42

It's an implementation thing. In Java 5 vs Java 6 they changed whether you could use "Override" with an interface (since Override seems to imply that you are overriding some sort of default behavior, which you are not doing with an interface!). If you so desire, you can search in the Eclipse preferences and change it from a compilation error to a compilation warning. You code inside of the CheckBox() function looks fine to me.

However, you are never calling the CheckBox function, so that's where the 'not used locally' error is coming from. Were you meaning to call that function from within the OnPreferenceClick method?

You can go to Project settings --> Java Compiler, and switch the compiler compliance level to 1.6. I have to do it every time i import an existing project.

just wanted to share, I wrote a post based on the info I found here. I hope it's helpful!

http://qtcstation.com/2011/05/android-and-jdk-compliance/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!