AndroidStudio中修改api帮助文档本地路径问题

最近更了一波Android Studio,更新之后又添加了很多功能,但是在使用过程中有一个很让人恼火的问题,按了查看api文档的快捷键后要先fetching document…一会儿才能看到,这简直是大大的有损开发效率,于是去了一趟google官网,查了下怎么设置参考文档的本地路径,成功解决了这个问题,这里做一个简单的说明:
 Solution:
 找到AS配置文件文件,一般在:
 

windows下:系统盘:C:\Users\username\.AndroidStudio2.3\config\options

Mac下:~/Library/Preferences/AndroidStudio2.3\config\options

用编辑器打开options目录下的jdk.table.xml文件,会看到xml文件结构如下:

<application>
  <component name="ProjectJdkTable">
    
    <jdk version="2">
      <name value="1.8" />
      <type value="JavaSDK" />
      <version value="java version "1.8.0_51"" />
      <homePath value="C:/Program Files/Java/jdk1.8.0_51" />
      <roots>
        <annotationsPath>
          <root type="composite">
            <root type="simple" url="jar://$APPLICATION_HOME_DIR$/lib/jdkAnnotations.jar!/" />
          root>
        annotationsPath>
        <classPath>
          <root type="composite">
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/charsets.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/deploy.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/ext/access-bridge-64.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/ext/cldrdata.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/ext/dnsns.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/ext/jaccess.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/ext/jfxrt.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/ext/localedata.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/ext/nashorn.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/ext/sunec.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/ext/sunjce_provider.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/ext/sunmscapi.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/ext/sunpkcs11.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/ext/zipfs.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/javaws.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/jce.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/jfr.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/jfxswt.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/jsse.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/management-agent.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/plugin.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/resources.jar!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/jre/lib/rt.jar!/" />
          root>
        classPath>
        
        <javadocPath>
          <root type="composite" />
        javadocPath>
        
        <sourcePath>
          <root type="composite">
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/src.zip!/" />
            <root type="simple" url="jar://C:/Program Files/Java/jdk1.8.0_51/javafx-src.zip!/" />
          root>
        sourcePath>
      roots>
      <additional />
    jdk>
    
    <jdk version="2">
      <name value="Android API 14 Platform" />
      <type value="Android SDK" />
      <homePath value="D:\AndroidStudioSDK" />
      <roots>
        <annotationsPath>
          <root type="composite">
            <root type="simple" url="jar://$APPLICATION_HOME_DIR$/plugins/android/lib/androidAnnotations.jar!/" />
          root>
        annotationsPath>
        <classPath>
          <root type="composite">
            <root type="simple" url="jar://D:/AndroidStudioSDK/platforms/android-14/android.jar!/" />
            <root type="simple" url="file://D:/AndroidStudioSDK/platforms/android-14/data/res" />
          root>
        classPath>
         -->
        <javadocPath>
          <root type="composite">
            <root type="simple" url="file://D:/AndroidStudioSDK/docs/reference" />
          root>
        javadocPath>
        
        <sourcePath>
          <root type="composite" />
        sourcePath>
      roots>
      
      <additional jdk="1.8" sdk="android-14" />
    jdk>

  component>
application>

将我注释的android api参考文档路径的地方改为sdk的安装目录下即可:SDK_INSTALL_DIR\docs\reference
完成改动后重启AS就好了,当然可以断网测试是否设置有效。如果还是fetching documeng…很慢,很乐意交流解决问题。

你可能感兴趣的:(Android基础,android,studio)