Hi, the previous launch method was to use "Activity.finish()" to close the activity, wait for about a second, and then start a new intent, but now I find that LightningLauncher will not be closed after launching the VR game. Why is this?
This is what I use now. It can start VR programs and 2D programs normally, but the startup will close the activity of the current program. Now I need to start the VR game without closing it.
function launchApp(pkgName, activityName)
local intent = Intent()
intent.setAction("android.intent.action.MAIN")
intent.addCategory("android.intent.category.LAUNCHER")
intent.setPackage(pkgName)
intent.setClassName(pkgName, activityName)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
-- Destroy the current Activity
activity.finish()
-- Wait for one second
os.execute("sleep " .. tonumber(1))
-- Start a new application
activity.startActivity(intent)
end
Hi, the previous launch method was to use "Activity.finish()" to close the activity, wait for about a second, and then start a new intent, but now I find that LightningLauncher will not be closed after launching the VR game. Why is this?
This is what I use now. It can start VR programs and 2D programs normally, but the startup will close the activity of the current program. Now I need to start the VR game without closing it.
function launchApp(pkgName, activityName) local intent = Intent() intent.setAction("android.intent.action.MAIN") intent.addCategory("android.intent.category.LAUNCHER") intent.setPackage(pkgName) intent.setClassName(pkgName, activityName) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
-- Destroy the current Activity activity.finish()
-- Wait for one second os.execute("sleep " .. tonumber(1))
-- Start a new application activity.startActivity(intent) end