You cannot view the source code with CTRL + click. The reason is that SDK Manager does not have the option to download the sources for Android SDK, so there is no source code associated with eclipse.
First, download android2.3.3 source code.
Http://rgruet.free.fr/public/android-2.3.3-gingerbread-src.zip
II. Create a new sources directory under the SDK directory and unzip the downloaded zip package in sources.
Take my machine as an example, in C:\Program files\android\android-sdk\platforms\android-10 under the new sources;
Copy the Android-2.3.3-gingerbread-src.zip to the sources and unzip to the current directory.
Third, modify the source.properties related configuration.
Take my machine as an example C:\Program files\android\android-sdk\platforms\android-10\source.properties modify four places, modified to
[HTML]View Plaincopy
- # # # Android Tool:source of this archive.
- #Sun Mar 01:51:13 CST 2012
- layoutlib.api=4
- layoutlib.revision=0
- pkg.desc=Android SDK Platform 2.3.3._r2
- Pkg.usersrc=true # # Add by Lu7kang-----------1
- Archive.arch= any
- platform.version=2.3.3
- # #Pkg.descurl=http\://developer.android.com/sdk/# # Delete by Lu7kkang---------------2
- platform.mintoolsrev=8
- archive.os= any
- # #Pkg.sourceurl=https\://dl-ssl.google.com/android/repository/repository-5.xml # # Delete by Luqk---------- 3
- pkg.revision=2
- Androidversion.apilevel=Ten
- pkg.sourceurl=Sources # # Add by Lu7kang---------4
Restart Eclipse, in Android engineering, press CTRL to click on the class name to read the android2.3 source.
Method Two:
The source is stacked in the Sources folder without decompression. Hold down CTRL, click on the Android SDK class, enter the source page can not be found, then click on the change attached source, and then click External File, find the corresponding source zip file, ok.
ADT Bundle cannot view source code