In Android, soft keyboard will be shown automatically when we launch an activity that contains a focusable EditText widget. But in some cases, we need to show or hide the soft keyboard manually or programatically. We can achieve this using InputMethodManager class.
Make sure to place those codes inside an activity.