android studio 提示 fetching documentation

在Android studio上使用快捷键查看某个方法的文档时,一直提示fetching documentation,无法加载出文档内容。

解决方法(来自stack overflow):

The problem is Android Studio does not automatically update the source link of reference even when the documentation is already downloaded.
The default link in jdk.table.xml is http://developer.android.com/reference/ (android studio tries to connect to this online server even if the network is blocked).
To solve the problem, we can just redirect the reference to local source.
On MacOS, the config file jdk.table.xml is under~/Library/Preferences/AndroidStudio/options/, and the docs are here: ~/Library/Android/sdk/docs/, or the custom path of your Android SDK.
In jdk.table.xml, find all the lines:

<root type="simple" url="http://developer.android.com/reference/">

and modify them to

<root type="simple" url="file://$USER_HOME$/Library/Android/sdk/docs/reference/">

On Windows, the file jdk.table.xml is under 
'C:\Users\Name.AndroidStudio2.x\config\options'

Then, in File -> Invalidate Caches / Restart… select Invalidate, and retry using Quick Documentation. It should display instantly. If it doesn't, select Invalidate and Restart, and you should be good to go.

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 174,638评论 25 709
  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,499评论 0 10
  • 失败者,往往是热度只有三分钟的人。成功者,往往是坚持最后五分钟的人。(星云法师语) 有一段时间,朋友圈里发的都是健...
    寒雨听音阅读 467评论 0 5
  • 你站在海的那一边看日出, 朝阳渐起; 我站在海的这一边看日落, 余辉渐隐。 同一片大海,两样风景。 你站在山的那一...
    落筆轩阅读 360评论 0 5