Android: Fix settings activity back button stopping emulation

This commit is contained in:
Connor McLaughlin 2020-09-13 14:37:28 +10:00
parent a053f389bd
commit c360b41a79
1 changed files with 12 additions and 0 deletions

View File

@ -1,7 +1,9 @@
package com.github.stenzek.duckstation;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.PreferenceFragmentCompat;
@ -22,6 +24,16 @@ public class SettingsActivity extends AppCompatActivity {
}
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == android.R.id.home) {
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
}
public static class SettingsFragment extends PreferenceFragmentCompat {
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {