Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to launch the lua code to run the game #5

Open
cgapk123 opened this issue Oct 7, 2023 · 0 comments
Open

How to launch the lua code to run the game #5

cgapk123 opened this issue Oct 7, 2023 · 0 comments

Comments

@cgapk123
Copy link

cgapk123 commented Oct 7, 2023

I'm very sorry, I shouldn't be asking here, but I really need to know how to fix this problem.

I use lua language to write an icon launcher program to launch the quest game, but it cannot jump to start the VR game. I have tried various methods to no avail. Can anyone tell me how to do it.

I don’t know what code needs to be written in the AndroidManifest.xml file
Below is my code:

--Create a function to start the quest game
function launchQuestGame(pkgName)
local intent = Intent()
.setClassName("com.oculus.vrshell", "com.oculus.vrshell.MainActivity")
.setAction(Intent.ACTION_VIEW)
.putExtra("uri", "vrshell://launch/" .. pkgName)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)

if intent.resolveActivity(packageManager) then
activity.startActivity(intent)
else
toast("Cannot start the application")
end
end

-- Called in another file directory, such as running the beat saber game
launchQuestGame(com.beatgames.beatsaber)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant