open keyboard on search view automatically

fixes 504
This commit is contained in:
Christian Schneppe 2020-11-17 17:48:21 +01:00
parent 707ca555dd
commit 8c60adf17f

View file

@ -60,9 +60,11 @@ public class SoftKeyboardUtils {
public static void showKeyboard(EditText editText) {
editText.requestFocus();
InputMethodManager inputMethodManager = (InputMethodManager) editText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if (inputMethodManager != null) {
inputMethodManager.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
try {
final InputMethodManager inputMethodManager = (InputMethodManager) editText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0);
} catch (Exception e) {
e.printStackTrace();
}
}
}