我做这两个步骤
额外的Android方式 需要两步:
标记您要用作库项目的项目 引用标记的项目 标记库项目
右键单击您的项目并选择属性。选择左侧的 Android 并勾选 IsLibrary 复选框。完毕。
引用标记的项目
右键单击您的项目并选择属性。选择左侧的 Android 并添加...您标记的项目。它将被添加到列表中并可以使用。现在您可以从引用的标记项目中访问所有类和资源(例如可绘制对象、字符串)。太棒了,嗯?:)
这里提到Eclipse Android 项目,如何在工作区中引用库?由 poitroae 但是......我在 locate 收到:
04-21 18:31:13.539: E/AndroidRuntime(19255): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.uploadvideo/com.examples.youtubeapidemo.FullscreenDemoActivity}; have you declared this activity in your AndroidManifest.xml?
和活动崩溃......
我所做的是在我添加的主项目中
Intent intent1 = new Intent(this,FullscreenDemoActivity.class);
intent1.putExtra("current_url",current_url);
startActivity(intent1);
在图书馆项目中我添加
Intent intent= getIntent();
current_url = intent.getStringExtra("current_url");
我希望我可以用意图在这个项目之间传递
谢谢 ...