package com.wpc.library.widget.verticalviewpager; import android.content.Context; import android.view.View; import android.view.inputmethod.InputMethodManager; /** * Created by weikou2015 on 2017/2/28. */ public class KeyBoard { /** * 判断软键盘是否弹出 */ public static boolean isSHowKeyboard(Context context, View v) { InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); if (imm.hideSoftInputFromWindow(v.getWindowToken(), 0)) { imm.showSoftInput(v, 0); return true; //软键盘已弹出 } else { return false; //软键盘未弹出 } } }