感谢这个主题,我能够在Windows上的Eclipse中为我的Android项目提供Javadoc链接.具体来说,"{@link android.widget.Toast}"目前已转换为" http://d.android.com/reference/android/widget/Toast.html?is-external=true " 的链接.我用Javadoc选项实现了这个目的:
-linkoffline http://d.android.com/reference"file:/ C:/ Android/android-sdk-windows/docs/reference"
但是,基于我的Java代码行(而不是Javadoc注释),我得到以下错误:
C:\Users\Ellen\workspace\TestableToast\src\edu\mills\cs180\HelloAndroid.java:5:
package android.view does not exist
import android.view.View;
^
C:\Users\Ellen\workspace\TestableToast\src\edu\mills\cs180\HelloAndroid.java:6:
package android.view.View does not exist
import android.view.View.OnClickListener;
^
C:\Users\Ellen\workspace\TestableToast\src\edu\mills\cs180\HelloAndroid.java:8:
package android.widget does not exist
import android.widget.Toast;
^
C:\Users\Ellen\workspace\TestableToast\src\edu\mills\cs180\HelloAndroid.java:10:
cannot find symbol symbol: class Activity
public class HelloAndroid extends Activity implements OnClickListener {
^
我该如何修复这些参考文献?
我正在尝试在Eclipse中为我的Android项目生成javadoc注释,但我不断收到NullPointerException.只有当我尝试为导入Android兼容性库(android.support)的类生成javadoc时才会出现此问题,我已将其作为外部jar附加.我还引用了Android 2.2和几个Library Projects,但这些不会导致这个错误.
Loading source file /home/travisc/Desktop/Android/App/workspace/Restaurant/src/com/yellowbrickcode/restaurant/StartupActivity.java...
Constructing Javadoc information...
StartupActivity.java:3: package android.content does not exist
import android.content.ContentValues;
^
StartupActivity.java:4: package android.content does not exist
import android.content.Intent;
^
StartupActivity.java:5: package android.content does not exist
import android.content.SharedPreferences;
^
StartupActivity.java:6: package android.content.SharedPreferences does not exist
import android.content.SharedPreferences.Editor;
^
StartupActivity.java:7: package android.os does not exist
import android.os.Bundle;
^
StartupActivity.java:8: package android.preference does not exist
import android.preference.PreferenceManager;
^
StartupActivity.java:10: package android.view does not exist
import android.view.Menu;
^
StartupActivity.java:11: package android.view does not …Run Code Online (Sandbox Code Playgroud)