diff --git a/src/android/app/src/main/java/org/citra/citra_emu/ui/TwoPaneOnBackPressedCallback.java b/src/android/app/src/main/java/org/citra/citra_emu/ui/TwoPaneOnBackPressedCallback.java index d07fe30d89..84ddf14391 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/ui/TwoPaneOnBackPressedCallback.java +++ b/src/android/app/src/main/java/org/citra/citra_emu/ui/TwoPaneOnBackPressedCallback.java @@ -1,6 +1,8 @@ package org.citra.citra_emu.ui; +import android.content.Context; import android.view.View; +import android.view.inputmethod.InputMethodManager; import androidx.activity.OnBackPressedCallback; import androidx.annotation.NonNull; @@ -32,6 +34,13 @@ public class TwoPaneOnBackPressedCallback extends OnBackPressedCallback @Override public void onPanelClosed(@NonNull View panel) { + closeKeyboard(); setEnabled(false); } + + private void closeKeyboard() { + InputMethodManager manager = (InputMethodManager) mSlidingPaneLayout.getContext() + .getSystemService(Context.INPUT_METHOD_SERVICE); + manager.hideSoftInputFromWindow(mSlidingPaneLayout.getRootView().getWindowToken(), 0); + } }