when we develop Android programs in eclipse, we often need to look at the source code (probably out of curiosity, probably read the source code habit). So how to view the Android source code it?
If we want to see the source code of the Activity class. Press the CTRL key. Left-click on it. The actual result can not see the code, the message is "Can't find Activity.class file".
At this point, click the button below, "Change attached Source ...". Choose the location of the Android source code.
The first is to select the working folder, that is, the existing Android application source code.
There are two different ways
(1) Select external File...button, add jar format file or zip format file path;
(2) Select External Floder...button and add the path to the directory.
The following questions are coming, where is the source? It can't be produced out of thin air.
Can download the source code via Android SDK manager. (recommend this method)
Tick the source for Android SDK. You can download it.
It can also be downloaded by other means. There are very many shared resources on the web.
Here is another way to choose the (2) method. Select the folder where the source code is located
Click "OK" button, at this time, the activity file will be able to view the source code.
The above content transferred from Baidu Experience
My personal choice is the first way. Because our company has the Android source code
Do application development How to view Android source code