0

I apologise if if 'hover assist' isn't the right terminology but I'm referring to the feature in Eclipse where if the use hovers the pointer over a method, a popup box appears with javadoc type information and invites the user to press F2 for focus. I see inconsistent behaviour for different methods, in that sometimes the browser gives me a file not found error when I click on a highlighted subject in that box.

I can best illustrate this by means of a snippet of code from a test project. I have the method:

@Override
   protected void onCreate(Bundle icicle) {
   super.onCreate(icicle);
   mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
   ... etc
   ...
}

If I hover over 'getSystemService' I see:

enter image description here .

and then click on 'String' it takes me to the javadocs page

file:///C:/dev/tools/android-sdk-windows4.0/docs/reference/java/lang/String.html

on my machine in the browser. (I use the Firefox external browser) and this is just what I want.

However if I hover over the onCreate, I see:

enter image description here

Then if I click on the 'Bundle' link, I get this in the browser:

**File not found

Firefox can't find the file at /C:/dev/projects/EclipseIndigo/AndroidWorkTwo/CompassTwo/src/reference/android/os/Bundle.html.**

I have built the project with Android 2.3.3 jar and the javadoc properties show

enter image description here

which validates OK. I don't understand this inconsistent behaviour. Any help will be much appreciated.

NickT
  • 23,844
  • 11
  • 78
  • 121
  • I guess you don't have the sources and javadoc referenced properly in your Eclipse project. Try right click on your project, build path, configure, look at the tab "librairies" and find Android. Check the location of the sources to see if it's pointing to the correct one. – Sephy Jan 03 '12 at 12:48
  • @Sephy: I'm not interested in the sources, just the javadocs. However in the project properties the android jar's javadoc location does point to the right location. That file is there and I can go it via the browser, if I navigate to it explicitly for 'Bundle'. Eclipse jumps to 'String' automatically but not to 'Bundle'. Both are below URL file:///C:/dev/tools/android-sdk-windows4.0/docs/reference – NickT Jan 03 '12 at 13:09

2 Answers2

0

The difference in both cases is the path "/docs/reference/java/" and "/src/reference/android/os/"

Please have a look at this url:

How to generate links to the android Classes' reference in javadoc?

It may guide you to correction.

Community
  • 1
  • 1
Sourab Sharma
  • 2,940
  • 1
  • 25
  • 38
  • It's not the source that I want, I just want the javadoc information. In the example I gave for 'Bundle' the information is already present on my machine in file:///C:/dev/tools/android-sdk-windows4.0/docs/reference/android/os/Bundle.html. I want to know why Eclipse won't send the browser to that URL – NickT Jan 03 '12 at 13:00
0

Solved: I think it's just a plain Eclipse bug.

When I hover over the (overriden) onCreate the popup's header shows it belonging to my package and activity which extends Activity (as it must do)

If I click on the link inside the popup : Overrides: onCreate(...) in Activity

The the popup changes to show the same information but in class:

void android.app.Activity.onCreate(Bundle savedInstanceState)

Then, if I click on 'Bundle' in the new popup, all is well, we get the javadocs.

It's almost as if Eclipse thinks that the class Bundle itself has been overriden too and looks for the javadocs in my source.

NickT
  • 23,844
  • 11
  • 78
  • 121