code: public static void showSoftKeyboard(Context context, View view) {
          if (view == null) {
              return;
          }
  
          final InputMethodManager manager = (InputMethodManager)
                  context.getSystemService(Context.INPUT_METHOD_SERVICE);
          view.requestFocus();
          manager.showSoftInput(view, 0);
      }
docs: Shows soft keyboard and requests focus for given view.