Example usage for android.view.inputmethod InputMethodManager showSoftInput

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

Introduction

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

Prototype

public boolean showSoftInput(View view, int flags) 

Source Link

Document

Synonym for #showSoftInput(View,int,ResultReceiver) without a result receiver: explicitly request that the current input method's soft input area be shown to the user, if needed.

Usage

From source file:Main.java

public static void showSoftKey(EditText et) {
    et.setFocusable(true);/*  ww w . jav  a  2  s  .com*/
    et.setFocusableInTouchMode(true);
    et.requestFocus();
    InputMethodManager inputManager = (InputMethodManager) et.getContext()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    inputManager.showSoftInput(et, 0);
}

From source file:Main.java

public static void showSoftKeyPad(Context context, View view) {
    try {//  ww w. j a  v  a 2s .c o m
        InputMethodManager inputManager = (InputMethodManager) context
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        inputManager.showSoftInput(view, InputMethodManager.RESULT_UNCHANGED_SHOWN);
    } catch (Throwable ex) {
    }
}

From source file:Main.java

@TargetApi(Build.VERSION_CODES.CUPCAKE)
public static void setKeyboardVisible(View view, boolean visible) {
    InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(INPUT_METHOD_SERVICE);
    if (visible) {
        imm.showSoftInput(view, 0);
    } else {//from  w w  w. j  av a  2s.co m
        imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
    }
}

From source file:Main.java

public static boolean showSoftInput(View view) {
    InputMethodManager imm = (InputMethodManager) view.getContext()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    return imm.showSoftInput(view, 2);
}

From source file:Main.java

/**
 * Show always Soft Keyboard//  w ww.j a va 2  s .co m
 *
 * @param context is current Activity
 */
public static void showKeyboard(Context context, EditText editText) {
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    if (editText != null) {
        imm.showSoftInput(editText, 0);
    }
}

From source file:Main.java

public static void showSoftKeyBoard(Activity activity, View view) {
    InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
    if (!imm.isActive(view)) {
        imm.showSoftInput(view, InputMethodManager.SHOW_FORCED);
    }//from  ww w .  j a v  a2  s.c om

}

From source file:Main.java

public static void showKeyboard(View view) {
    view.requestFocus();/*from w ww .j a  v  a  2s  . co  m*/
    InputMethodManager inputManager = (InputMethodManager) view.getContext()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    inputManager.showSoftInput(view, 0);
}

From source file:Main.java

public static void showInputMethodWindow(Activity activity, View view) {
    try {/*from  w ww. j  a va2  s  . co  m*/
        InputMethodManager inputMethodManager = (InputMethodManager) activity
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        inputMethodManager.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
    } catch (Throwable e) {
    }
}

From source file:Main.java

public static void showInput(View view) {
    if (view == null)
        return;/*from  w  ww  . j  a va  2s .c  o m*/

    InputMethodManager inputMethodManager = (InputMethodManager) view.getContext()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    inputMethodManager.showSoftInput(view, InputMethodManager.SHOW_FORCED);
}

From source file:Main.java

public static void showKeyboard(View view) {
    if (view == null) {
        return;//from w w w .ja v  a2s .  co m
    }
    InputMethodManager inputManager = (InputMethodManager) view.getContext()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    inputManager.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
}