Thanks to the @Shubham link, I was able to figure this out. However, the solution was not the answer referenced in the link. This was the second answer.
editText.requestFocus(); InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
Edit:
after using the above solution, the keyboard will remain on the screen until the user presses the back button or the home button (sometimes this takes several times). To remove the keyboard, use
imm.toggleSoftInputFromWindow(rootView.getWindowToken(), 0,0);
in my case, rootView is the rootView of the current activity. I have not tested this to see if this will work on child views.
source share