Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
704 views
in Technique[技术] by (71.8m points)

eclipse - How to attach source to android.jar

I am new to Android. I am working in the Windows OS with the Eclipse IDE. My simple application has a spinner that populates a list from database column. When I click on the spinner Class, the file Editor says that source not found and the android.jar has no source attachment.

I downloaded the source code and placed it in this location:

android-sdk-windowsplatformsandroid-8

Then, I attached this source by these steps:

right click the project => build path=> configure build path=> libraries => source attachment => give the path of the source code downloaded.

But, I didn't get any solution for my debug. Again, when clicking on the spinner it opens the debug that android.jar has no source attachment.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is now really easy!

Go to Window->Android SDK Manager and install "Sources for Android SDK".

Now try to control-click some Android identify, you will get the usual "no source attached" page. Click "Attach Source" and get the option to select an external folder.

Now browse to /home/me/android-sdks/sources/android-16 (or wherever your SDK is installed; this is the default), and hit ok.

It should think for a moment and then display the source! Yeay!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...