开发者

JavaDoc not working in Android project

开发者 https://www.devze.com 2023-01-18 05:28 出处:网络
I\'m using Eclipse 3.5.2 for Android development on Ubuntu 10.04. I installed: Sun\'s JDK from Ubuntu\'s repositories;

I'm using Eclipse 3.5.2 for Android development on Ubuntu 10.04. I installed:

  • Sun's JDK from Ubuntu's repositories;
  • Eclipse 开发者_C百科3.5.2 (Classic) from eclipse.org, unpacked to /opt/eclipse
  • The Android SDK from android.com, unpacked to /opt/android-sdk

My problem is that when I'm in an Android project, JavaDoc will not work (neither for Android classes nor for Java classes). For example, if I hover my mouse over DateFormat, I get:

java.text.DateFormat

Note: The Javadoc for this element could neither be found in the attached source nor the attached Javadoc.

However, if I hover my mouse over DateFormat while I'm editing a normal, Java project, I do get the correct JavaDoc:

java.text.DateFormat

DateFormat is an abstract class for date/time formatting subclasses which formats and parses dates or time in a language-independent manner. ...

So the JavaDoc is there, it's just not accessible from inside Android projects, for some strange reason.

Any ideas what that reason might be?


Had the same problem even after documentation package installation. Here how i solved the problem:

  1. Go to Project->Properties->JavaBuild path->Libraries
  2. Expand Androidxxx
  3. Expand android.jar
  4. Select JavaDoc location and choose Edit option
  5. Check if path correct


Just resolved this myself, here's what I did (from inside Eclipse):

  • Go to menu "Window" -> "Android SDK and AVD manager"
  • Click "Available Packages" in the window that appears
  • Check the "Documentation ..." package. Note that I had only one documentation package to choose from, and it was for a newer version of the SDK than what I was using, but it was good enough.
  • Click "Install Selected".

Now, just wait for the install to finish and you should have Javadoc hovers for most API calls.

Regards /J

0

精彩评论

暂无评论...
验证码 换一张
取 消