View the Android framework source code in Android Eclipse
Sometimes I use Eclipse to press ctrl to view the source code. What should I do?
The following steps allow you to easily view the source code:
Project-> properties-> java build path-> libraries
Click source under android. jar:
Here you can add zip files and folders. zip files can be downloaded from git. Here I use the source code downloaded using sdk manager, as shown below:
The source code downloaded here is saved under the source under the sdk. You can select a platform Association.
The following is the source code of the button:
@RemoteViewpublic class Button extends TextView { public Button(Context context) { this(context, null); } public Button(Context context, AttributeSet attrs) { this(context, attrs, com.android.internal.R.attr.buttonStyle); } public Button(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); event.setClassName(Button.class.getName()); } @Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(info); info.setClassName(Button.class.getName()); }}