I have created a login activity in android studio. After login user should enter the unity scene.How should I switch between android studio and unity within the same apk. I dont want to create two diffrent apks.
How do I load a unity scene after I login? The login screen is made in android studio.How to switch?
Start the UnityPlayerActivity after your login activity finishes.
Embedded Unity within Android App | by David Beloosesky | Medium.
EDIT: (It required some constraint on my part to not ask why you want to make your life so hard by doing this, but I’ll leave it alone.)
Actually I am creating a VR app. So I need to switch.
That is a great help. Thanks a lot!!
I have managed to embed unity within the android app, but my VR scene is getting loaded in non VR mode in the android app.
I have added a listener to a button which starts the unityplayeractivity.class intent.
If I install the VR scene as an independent app then it gets loaded in VR mode.
I dont understand the problem here. Please help!

Also below is the AndroidManifest.xml of the Unity project. Do I need to make any changes to load the VR scene in VR mode (SPLIT SCREEN)?
I have commented the intent part because I imported the unity project as library in my main android project.
