Merge pull request #7754 from JosJuice/android-selectedgames

Android: Use SelectedGames instead of SelectedGame in StartupHandler
This commit is contained in:
JosJuice 2019-01-30 19:02:26 +01:00 committed by GitHub
commit 06241fa409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 4 deletions

View File

@ -26,18 +26,26 @@ public final class StartupHandler
// Ask the user if he wants to enable analytics if we haven't yet. // Ask the user if he wants to enable analytics if we haven't yet.
Analytics.checkAnalyticsInit(parent); Analytics.checkAnalyticsInit(parent);
String start_file = ""; String[] start_files = null;
Bundle extras = parent.getIntent().getExtras(); Bundle extras = parent.getIntent().getExtras();
if (extras != null) if (extras != null)
{ {
start_file = extras.getString("AutoStartFile"); start_files = extras.getStringArray("AutoStartFiles");
if (start_files == null)
{
String start_file = extras.getString("AutoStartFile");
if (!TextUtils.isEmpty(start_file))
{
start_files = new String[]{start_file};
}
}
} }
if (!TextUtils.isEmpty(start_file)) if (start_files != null && start_files.length > 0)
{ {
// Start the emulation activity, send the ISO passed in and finish the main activity // Start the emulation activity, send the ISO passed in and finish the main activity
Intent emulation_intent = new Intent(parent, EmulationActivity.class); Intent emulation_intent = new Intent(parent, EmulationActivity.class);
emulation_intent.putExtra("SelectedGame", start_file); emulation_intent.putExtra(EmulationActivity.EXTRA_SELECTED_GAMES, start_files);
parent.startActivity(emulation_intent); parent.startActivity(emulation_intent);
parent.finish(); parent.finish();
} }