Example usage for android.view.inputmethod InputMethodManager toggleSoftInput

List of usage examples for android.view.inputmethod InputMethodManager toggleSoftInput

Introduction

In this page you can find the example usage for android.view.inputmethod InputMethodManager toggleSoftInput.

Prototype

public void toggleSoftInput(int showFlags, int hideFlags) 

Source Link

Document

This method toggles the input method window display.

Usage

From source file:Main.java

public static void showInput(Context context) {
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.toggleSoftInput(0, InputMethodManager.SHOW_FORCED);
}

From source file:Main.java

public static void showKeyBoard(Context context) {
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
}

From source file:Main.java

public static void hideInput(Context context) {
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
}

From source file:Main.java

public static void toggleSoftKeybord(Context context) {
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
}

From source file:Main.java

public static void showKeyboard(Context context) {
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.toggleSoftInput(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE, InputMethodManager.SHOW_FORCED);
}

From source file:Main.java

public static void toggleKeyBoard(Activity activity) {
    InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
}

From source file:Main.java

public static void openKeyboard(Context context) {
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);

}

From source file:Main.java

public static void showSoftKeyboard(Context context, EditText editText) {
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
    editText.requestFocus();//from   w w  w . ja v a  2  s.  com
}

From source file:Main.java

public static void showOrHideSoftInput(Activity activity) {
    InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
}

From source file:Main.java

public static void showKeyBoard(Context context, View view) {
    view.requestFocus();/*from   w  w w .jav a 2  s .co m*/
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
}