mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Android: require back to be pressed twice to exit on mobile
This commit is contained in:
parent
a2b97665bb
commit
a2f90d3915
@ -78,6 +78,7 @@ public final class EmulationActivity extends AppCompatActivity
|
||||
private String mSelectedTitle;
|
||||
private int mPlatform;
|
||||
private String mPath;
|
||||
private boolean backPressedOnce = false;
|
||||
|
||||
public static final String EXTRA_SELECTED_GAME = "SelectedGame";
|
||||
public static final String EXTRA_SELECTED_TITLE = "SelectedTitle";
|
||||
@ -329,10 +330,18 @@ public final class EmulationActivity extends AppCompatActivity
|
||||
}
|
||||
else
|
||||
{
|
||||
mEmulationFragment.stopEmulation();
|
||||
exitWithAnimation();
|
||||
if (backPressedOnce)
|
||||
{
|
||||
mEmulationFragment.stopEmulation();
|
||||
exitWithAnimation();
|
||||
}
|
||||
else
|
||||
{
|
||||
backPressedOnce = true;
|
||||
Toast.makeText(this, "Press back again to exit", Toast.LENGTH_LONG).show();
|
||||
new Handler().postDelayed(() -> backPressedOnce = false, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user