This answer recommends using AndroidManifest's android:launchMode="singleTask"
to limit an activity to a single instance.
That's great for applications in which all activities are part of the project, but when I have several application using a Library Project in which the application's main activity is defined, the Library Project's AndroidManifest is ignored and so I can't really use that android:launchMode="singleTask"
attribute there.
If I use that android:launchMode="singleTask"
in the application's AndroidManifest.xml, then each activity has a different name and this attribute will limit to a single instance only the same application, not different applications using this shared activity (used as a Library Project).
What I really want is that at any given moment, only one application (among the different applications using that shared Library Project's activity) can run.
Is this doable using the android:launchMode="singleTask"
attribute?
If this isn't possible, what other approach is recommended?