Android: Add an AutoStartFiles in addition to AutoStartFile

Lets launchers specify multiple discs to launch, for automatic disc
switching.
This commit is contained in:
JosJuice 2019-01-28 20:26:04 +01:00
parent 2c6a975d1f
commit 3639607849
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(EmulationActivity.EXTRA_SELECTED_GAMES, new String[]{start_file}); emulation_intent.putExtra(EmulationActivity.EXTRA_SELECTED_GAMES, start_files);
parent.startActivity(emulation_intent); parent.startActivity(emulation_intent);
parent.finish(); parent.finish();
} }