Android: Fix controller 1 default type of "Not Set"

This commit is contained in:
Connor McLaughlin 2021-03-20 02:24:57 +10:00
parent ab02fbdfad
commit 7e4453a7d4

View File

@ -216,7 +216,7 @@ public class ControllerSettingsActivity extends AppCompatActivity {
private void createPreferences() {
final PreferenceScreen ps = getPreferenceScreen();
final SharedPreferences sp = getPreferenceManager().getSharedPreferences();
final String defaultControllerType = controllerIndex == 0 ? "DigitalController" : "None";
final String defaultControllerType = (controllerIndex == 1) ? "DigitalController" : "None";
final String controllerTypeKey = String.format("Controller%d/Type", controllerIndex);
final String controllerType = sp.getString(controllerTypeKey, defaultControllerType);
final String[] controllerButtons = AndroidHostInterface.getControllerButtonNames(controllerType);
@ -227,6 +227,7 @@ public class ControllerSettingsActivity extends AppCompatActivity {
typePreference.setEntries(R.array.settings_controller_type_entries);
typePreference.setEntryValues(R.array.settings_controller_type_values);
typePreference.setKey(controllerTypeKey);
typePreference.setValue(controllerType);
typePreference.setTitle(R.string.settings_controller_type);
typePreference.setSummaryProvider(ListPreference.SimpleSummaryProvider.getInstance());
typePreference.setIconSpaceReserved(false);