I have an Android library project that I would like to use from within another Android project.
The library has a Activity declared in its AndroidManifest. When I t
I believe you must include the <activity> in your own AndroidManifest.xml -- I don't think it gets picked up from a library. I don't have my reference for that handy.
Update: It's official solution. From the doc:
Declaring library components in the manifest file
In the manifest file of the application project, you must add declarations of all components that the application will use that are imported from a library project. For example, you must declare any
<activity>
,<service>
,<receiver>
,<provider>
, and so on, as well as<permission>
,<uses-library>
, and similar elements.Declarations should reference the library components by their fully-qualified package names, where appropriate.
When using an activity inside the library, the activity should be declared only inside the manifest of library. The activity can be started from the main app like this:
Intent intent = new Intent();
intent.setClassName(this, "com.duna.remotelocklibrary.activities.MainRemoteActivity");
startActivity(intent);
I tried to start the library's activity like the following code, but i warn you: it doesn't work
Intent intent = new Intent();
intent.setClassName("com.duna.remotelocklibrary", "com.duna.remotelocklibrary.activities.MainRemoteActivity");
startActivity(intent);