package com.quickblox.sample.core.utils; import android.content.Context; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import com.quickblox.sample.core.CoreApp; public class KeyboardUtils { public static void showKeyboard(EditText editText) { InputMethodManager imm = (InputMethodManager) CoreApp.getInstance().getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT); } public static void hideKeyboard(EditText editText) { InputMethodManager imm = (InputMethodManager) CoreApp.getInstance().getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editText.getWindowToken(), 0); } }