To show software keyboard when focusing textedit in Android you can use the snippet below.

Sample Java

myTextEdit.setOnFocusChangeListener(new View.OnFocusChangeListener() {
    @Override
    public void onFocusChange(View view, boolean focus) {
        if (focus) {
            dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
        }
    }
});

3 thought on “How to show software keyboard when focusing textedit in Android”

Leave a Reply