別の Android プロジェクト内から使用したい Android ライブラリ プロジェクトがあります。
ライブラリには、その AndroidManifest で宣言された Activity があります。2番目のプロジェクト内で次のことを試すと:
Intent intent = new Intent(this, ReaderActivity.class);
startActivity(intent);
次の例外が発生します。
java.lang.RuntimeException: Unable to start activity ComponentInfo{br.com.digitalpages.reader.demo/br.com.digitalpages.reader.demo.ReaderDemoActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {br.com.digitalpages.reader.demo/br.com.digitalpages.reader.ReaderActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
...
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {br.com.digitalpages.reader.demo/br.com.digitalpages.reader.ReaderActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
...
別のプロジェクトからアクティビティを開くにはどうすればよいですか?
編集:ユーザーの回答により、2番目のプロジェクトに次の行を追加しました
<uses-library android:name="br.com.digitalpages.reader" android:required="true" />
しかし、それはまだ動作しません