I really doubt that Eclipse is wrong here. First, a couple quick-and- basic steps.
If you hold the mouse over each variable, it will tell you the type. Finally, if you click on the 'this' the code, and type control-T, you'll get a pop-up with showing the class hierarchy. The second from the type should read 'Context -- android.content' Now, finally: On the left where it shows the Package Explorer, click right on your project name (at the top level of the hierarchy). Choose Properties, and then choose Android in the property pane that comes up, to see the Android-related properties. It will give you a table of Android target names. My guess: You have selected Android 1.1 (API Level 2). The method in question, according to the nice Javadoc, was introduced in API level 3. Then Eclipse should let you build your code. Eclipse is telling you that the method isn't available in that version of the SDK. It compiles against that specific version of android.jar, based on that checkbox. So what does it mean to select a different version? It means your code will compile, but will only work on devices newer than Android 1.1. In the androidManifest.xml file, there are flags indicating what the minimum and intended SDK versions are. If you indicate it should work on API 2, they'll be able to install it, but get a NoSuchMethodError at runtime. There are very few devices running Android 1.1, but you'll have to decide what you want to do about that. Statistics are available. On Feb 24, 7:28 am, Mark Murphy <[email protected]> wrote: > Nick Owens wrote: > > The error in the screenshot (emailed separately), shows: > > > "The method getRelativeDateTimeString(ResourcesList, long, long, long, int) > > is undefined for the type" > > > The declaration of my Activity is: > > > Public class ResourcesList extends ListActivity > > > I'm missing something stupid, right? > > Well, I'm not an Eclipse user. What you have should be fine, and I don't > know why it is coming up with that complaint. > > My standard hammer for nails like this is Project > Force Clean, to see > if that clears matters up. > > But, I've taught enough people who use Eclipse to see that Eclipse is > more frequently wrong about what's in the SDK than are the SDK docs. So, > if you get errors like this, check the docs first. > > And, this is one of the umpteen reasons why I don't use Eclipse. > > (saying that in part to see if Eric Cloninger is watching this thread, > to perhaps goad him into providing other solutions for dealing with > Eclipse tossing up errors on what, on the surface, looks like perfectly > good code) > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > _Beginning Android_ from Apress Now Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

