How can I enable javadoc for the Android support library?

前端 未结 3 1787
南笙
南笙 2020-12-02 19:47

When using the Android support library for compatibility and try to view the javadoc for, say, FragmentTransaction, I get the following error because there is n

相关标签:
3条回答
  • 2020-12-02 20:30

    Edited: Refer the following post :

    How to attach javadoc or sources to jars in libs folder?

    Added:

    Under \android-sdk\extras\android\support\v4 directory of your Android SDK installation you will find the sources for android-support-v4.jar (i.e. the src directory) and you can create a jar file of the same using jar command.

    Hope it helps :)

    Added:

    Check this post https://android-review.googlesource.com/#/c/35702/

    according to this

    Create a file named android-support-v4.jar.properties in the libs directory of your project and add following line into it.

    src: <relative or absolute path to the source folder (or archive).>

    I tried this solution and it worked for me. Enjoy :)

    0 讨论(0)
  • 2020-12-02 20:48

    I've lashed together a project with android-support-v4.jar just in the Android Dependencies part of the package view. I have a class

    public class CountriesFragment extends ListFragment {...}
    

    and an import of

    import android.support.v4.app.ListFragment;
    

    up above

    I created a file android-support-v4.jar.properties in the libs folder. It contains the lines:

    doc=c:\\[path-to-android-sdk]\\docs\\reference
    src=C:\\[path-to-android-sdk]\\extras\\android\\support\\v4\\src
    

    Presumably you'll have to change to un-escaped forward slashes if not using Windows.

    Next right-click the project, select refresh, then you'll get javadoc support. You don't really need the doc entry--the src entry already contains the javadocs.

    0 讨论(0)
  • 2020-12-02 20:49

    In Eclipse: Go to File Menu-> Open file-> browse your Project directory in workspace -> select the .classpath file openit->

    Keep only below entries in this file and remove all others

    `<?xml version="1.0" encoding="UTF-8"?>
    <classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="src" path="gen"/>
    <classpathentry kind="lib" path="your dir path without space.../extras/android/support /v4/android-support-v4.jar"/>
    <classpathentry kind="output" path="bin/classes"/>
     </classpath>
    

    Save the file. then in Eclipse-> Package Explorer ->right click Project -> Android tools -> Fix Project Properties.

    This will add all required files to project , if you want to cross check open .classpath file again and check updates in it.

    Run the project successfully :)

    0 讨论(0)
提交回复
热议问题