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