I have the android 4.1 and 4.0 SDK installed on my laptop. I’ve done plenty of projects just using a blank activity, but when I decided to try a “master detail flow” example from within Eclipse (create new Android project, select MasterDetailFlow) the other day it wouldn’t even let me build. I have errors right off the bat. Surely this can’t be right? Here are the errors:
(1)The method onItemSelected(String) of type ItemListActivity must override a superclass method ItemListActivity.java /Master Detail/src/com/example/master/detail line 39 Java Problem
(2)The method onItemSelected(String) of type new ItemListFragment.Callbacks(){} must override a superclass method ItemListFragment.java /Master Detail/src/com/example/master/detail line 27 Java Problem
I’d like to try and use the master detail forms so I can understand more advanced android layouts. Could anyone point me into a better direction with that as well? Thanks!
Ugh, that’s a pain, but it’s a pretty simple solution. The rules for when you should/shouldn’t use @Override switched from Java 5 to Java 6, so depending on Eclipse’s default JDK it’ll sometimes yell at you when @Override isn’t there but should be, or vice versa.
Set the compiler level in Eclipse to at least JDK 6 and the errors will magically disappear 🙂