简体   繁体   English

jodatime javadoc文档未显示在Android Studio中

[英]jodatime javadoc documents does not show up in Android Studio

I am trying to use joda-time in Android Studio. 我正在尝试在Android Studio中使用joda-time。 I have added joda-time-2.3.jar and joda-time-2.3-javadoc.jar to the libs folder of my app. 我已将joda-time-2.3.jarjoda-time-2.3-javadoc.jar到应用程序的libs文件夹中。 The problem is when I hit ctrl+q to show the quick documentation about the method that I want to use, it does not show anything. 问题是当我按ctrl+q显示有关我要使用的方法的快速文档时,它什么也没有显示。

I wonder how can I make the Android Studio to load the documentation for the joda-time? 我想知道如何使Android Studio加载joda-time的文档吗? any ideas? 有任何想法吗?

Option #1 选项1

You can expand the joda-time-2.3.jar node in the Project View (under libs), open any of the classes inside, and then select "Attach Sources". 您可以在项目视图中(在libs下)展开joda-time-2.3.jar节点,打开其中的任何类,然后选择“附加源”。

In the file picker, just select the joda-time-2.3-sources.jar file. 在文件选择器中,只需选择joda-time-2.3-sources.jar文件。 And you're done. 这样就完成了。

Option #2 选项#2

You could also include the JodaTime dependency via gradle/maven instead of including the jar file. 您还可以通过gradle / maven包括JodaTime依赖关系,而不是包括jar文件。 For that, just remove the compile files('libs/joda-time-2.3.jar') line in build.gradle (as well as the jar file itself) and add in its place: 对于这一点,只是删除compile files('libs/joda-time-2.3.jar')的线build.gradle (以及JAR文件本身),并添加在它的位置:

compile 'joda-time:joda-time:2.3'

That will automatically download the library, as well as its source jar. 这将自动下载该库及其源jar。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM