android 關閉軟鍵盤

/**
     * 關閉軟鍵盤
     */
    public static void hideInputMethod(Context context, View view) {
        InputMethodManager imm = (InputMethodManager)
                context.getSystemService(Context.INPUT_METHOD_SERVICE);
        if (imm != null) {
            imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
        }
    }
相關文章
相關標籤/搜索