package com.sogouchat.search; import android.content.Context; import android.view.View; import android.view.inputmethod.InputMethodManager; public class InputViewShowHelper { public static void SetInputShow(boolean bShow,Context context,View view){ if (bShow) { InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(view,InputMethodManager.SHOW_FORCED); imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS); } else { InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } } }