兩個方法,但是方法1可能有很多人用不上:
1、File->Other Settings->Default Project Structure,如果有SDKs選項,你就可以從中配置添加/修改源碼版本了;
2、利用方法1發現沒有SDKs選項,還可以通過修改一個xml的配置文件進行源碼關聯:
打開文件:C:\Users\{username}\.AndroidStudio2.2\config\options\jdk.table.xml
代碼片段:
<sourcePath>
<root type="composite">
<root type="simple" url="file://D:/AndroidSdk/sources/android-24" />
</root>
</sourcePath>
在所有的<sourcePath> 節點修改/添加對應的源碼本地url。
重啓android studio即可。