Here you can find the source of isSoftKeyboardActive(Activity activity)
public static boolean isSoftKeyboardActive(Activity activity)
//package com.java2s; //License from project: Open Source License import android.app.Activity; import android.content.Context; import android.view.inputmethod.InputMethodManager; public class Main { public static boolean isSoftKeyboardActive(Activity activity) { if (activity == null) return false; InputMethodManager inputManager = (InputMethodManager) activity .getSystemService(Context.INPUT_METHOD_SERVICE); return inputManager.isAcceptingText(); }/*from ww w .jav a 2 s. com*/ }