How to open an activity from different package (imported module) in android?

167 views Asked by At

I have an android project (let's call this Base) in which I have added/imported a new project. Now, I have to open an activity in the new project (imported module) from the Base project.

How could this be achieved?

From the screenshot, I want to open UnityPlayerActivity in a class under androidLauncher package

enter image description here

I tried using packageManager,

Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.unity3d.player.UnityPlayerActivity");
                if (launchIntent != null) {
                    startActivity(launchIntent);
                }

This did not work as it is not getting the package name.

Edit: added root structure for the manifest files Manifest file structure

0

There are 0 answers