在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.
网友评论