diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java index c962fba4fd..10e803bc19 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java @@ -468,7 +468,11 @@ public final class EmulationActivity extends AppCompatActivity @Override public boolean onOptionsItemSelected(MenuItem item) { - handleMenuAction(buttonsActionsMap.get(item.getItemId())); + int action = buttonsActionsMap.get(item.getItemId(), -1); + if (action >= 0) + { + handleMenuAction(action); + } return true; } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/LoadStateFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/LoadStateFragment.java index 2fbbc1838b..95d5df94f5 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/LoadStateFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/LoadStateFragment.java @@ -62,6 +62,10 @@ public final class LoadStateFragment extends Fragment implements View.OnClickLis @Override public void onClick(View button) { - ((EmulationActivity) getActivity()).handleMenuAction(buttonsActionsMap.get(button.getId())); + int action = buttonsActionsMap.get(button.getId(), -1); + if (action >= 0) + { + ((EmulationActivity) getActivity()).handleMenuAction(action); + } } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java index f83b0a4f98..236ed89228 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java @@ -54,7 +54,11 @@ public final class MenuFragment extends Fragment implements View.OnClickListener @Override public void onClick(View button) { - ((EmulationActivity) getActivity()).handleMenuAction(buttonsActionsMap.get(button.getId())); + int action = buttonsActionsMap.get(button.getId()); + if (action >= 0) + { + ((EmulationActivity) getActivity()).handleMenuAction(action); + } } public void setTitleText(String title) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveStateFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveStateFragment.java index 4ddebc37d9..f6d9482ebf 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveStateFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveStateFragment.java @@ -62,6 +62,10 @@ public final class SaveStateFragment extends Fragment implements View.OnClickLis @Override public void onClick(View button) { - ((EmulationActivity) getActivity()).handleMenuAction(buttonsActionsMap.get(button.getId())); + int action = buttonsActionsMap.get(button.getId(), -1); + if (action >= 0) + { + ((EmulationActivity) getActivity()).handleMenuAction(action); + } } }