mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Merge pull request #12345 from minhaferzz/startup-handler
Android: Fix issue when launching a game when Dolphin is not open
This commit is contained in:
commit
2199dd26bb
@ -1066,16 +1066,16 @@ class EmulationActivity : AppCompatActivity(), ThemeProvider {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun launch(activity: FragmentActivity, filePaths: Array<String>, riivolution: Boolean) {
|
||||
fun launch(activity: FragmentActivity, filePaths: Array<String>, riivolution: Boolean, fromIntent: Boolean = false) {
|
||||
if (ignoreLaunchRequests)
|
||||
return
|
||||
|
||||
performLaunchChecks(activity) { launchWithoutChecks(activity, filePaths, riivolution) }
|
||||
performLaunchChecks(activity, fromIntent) { launchWithoutChecks(activity, filePaths, riivolution) }
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun launch(activity: FragmentActivity, filePath: String, riivolution: Boolean) =
|
||||
launch(activity, arrayOf(filePath), riivolution)
|
||||
fun launch(activity: FragmentActivity, filePath: String, riivolution: Boolean, fromIntent: Boolean = false) =
|
||||
launch(activity, arrayOf(filePath), riivolution, fromIntent)
|
||||
|
||||
private fun launchWithoutChecks(
|
||||
activity: FragmentActivity,
|
||||
@ -1089,8 +1089,11 @@ class EmulationActivity : AppCompatActivity(), ThemeProvider {
|
||||
activity.startActivity(launcher)
|
||||
}
|
||||
|
||||
private fun performLaunchChecks(activity: FragmentActivity, continueCallback: Runnable) {
|
||||
private fun performLaunchChecks(activity: FragmentActivity, fromIntent: Boolean, continueCallback: Runnable) {
|
||||
AfterDirectoryInitializationRunner().runWithLifecycle(activity) {
|
||||
if (fromIntent) {
|
||||
activity.finish()
|
||||
}
|
||||
if (!FileBrowserHelper.isPathEmptyOrValid(StringSetting.MAIN_DEFAULT_ISO) ||
|
||||
!FileBrowserHelper.isPathEmptyOrValid(StringSetting.MAIN_FS_PATH) ||
|
||||
!FileBrowserHelper.isPathEmptyOrValid(StringSetting.MAIN_DUMP_PATH) ||
|
||||
@ -1129,7 +1132,7 @@ class EmulationActivity : AppCompatActivity(), ThemeProvider {
|
||||
if (ignoreLaunchRequests)
|
||||
return
|
||||
|
||||
performLaunchChecks(activity) { launchSystemMenuWithoutChecks(activity) }
|
||||
performLaunchChecks(activity, false) { launchSystemMenuWithoutChecks(activity) }
|
||||
}
|
||||
|
||||
private fun launchSystemMenuWithoutChecks(activity: FragmentActivity) {
|
||||
|
@ -37,8 +37,7 @@ public final class StartupHandler
|
||||
if (gamesToLaunch != null && gamesToLaunch.length > 0)
|
||||
{
|
||||
// Start the emulation activity, send the ISO passed in and finish the main activity
|
||||
EmulationActivity.launch(parent, gamesToLaunch, false);
|
||||
parent.finish();
|
||||
EmulationActivity.launch(parent, gamesToLaunch, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user