3

When I use the command 'Quick Documentation' in Android Studio in a class that comes from one of the support libraries (e.g. ActionBarActivity), the IDE does not show the documentation for the class. If I use it on one of the classes from, say, the Android API 19 (e.g. Activity), the IDE displays the complete documentation as is shown in the reference page on https://developer.android.com/reference/packages.html.

Is there any way to add the documentation for the support libraries to Android Studio so that they can be accessed through 'Quick Documentation' as well?

Ricardo Lima
  • 285
  • 1
  • 8
  • possible duplicate of ["Go to implementation" of an Android API class opens .class file, not .java](http://stackoverflow.com/questions/20733306/go-to-implementation-of-an-android-api-class-opens-class-file-not-java) – Scott Barta Jan 31 '14 at 21:50
  • @ScottBarta, is your answer in this other question the reason why the documentation won't show? – Ricardo Lima Feb 01 '14 at 15:12
  • Yes, it's not working because you can't associate Javadoc (or source) with library jars. – Scott Barta Feb 01 '14 at 15:19

2 Answers2

1

When Android Studio has opened the decompiled jar class, click on "Download..." blue link at top right, this will download jar with javadoc and save it in :

/.ideaLibSources

rebuild project if necessary, now doc is available. Tested on android studio 2.0 preview 4.

Nicolas Bossard
  • 1,077
  • 1
  • 10
  • 15
0

If you are not using Gradle, this will be easier for you.

Go to File -> Project Structure. From there, on the left-hand side, select Libraries. Select the library you want to add source/java-docs to, then click the plus at the bottom and add the source and/or java-doc jars. There's a chance AS will automatically know what's what.

If you're using Gradle, more than likely in Project Structure, you won't see the Libraries tab, and I'm sorry but I don't know how to help from that point. If you use Gradle, AS detects that and takes away "unnecessary" options. Sorry to send you searching again, but I know there's something called a .properties file for jars that tell the source and java-docs, but I haven't implemented it. If I can find the page that told me that information, I'll update this.

EDIT: The answer is here. This should help you out.

Community
  • 1
  • 1
gatlingxyz
  • 781
  • 6
  • 12