Android: Fix crash if activity is killed before returning
This commit is contained in:
parent
c18278e664
commit
8f74d4718f
|
@ -235,6 +235,12 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
|
||||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
|
||||||
|
if (!AndroidHostInterface.hasInstanceAndEmulationThreadIsRunning()) {
|
||||||
|
// we must've got killed off in the background :(
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (requestCode == REQUEST_CODE_SETTINGS) {
|
if (requestCode == REQUEST_CODE_SETTINGS) {
|
||||||
if (AndroidHostInterface.getInstance().isEmulationThreadRunning())
|
if (AndroidHostInterface.getInstance().isEmulationThreadRunning())
|
||||||
applySettings();
|
applySettings();
|
||||||
|
|
Loading…
Reference in New Issue