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 showSoftInput(Context context, EditText edit) {
    edit.setFocusable(true);//from  w w w  .  j  a va2s.  c  o m
    edit.setFocusableInTouchMode(true);
    edit.requestFocus();
    InputMethodManager inputManager = (InputMethodManager) context
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    inputManager.showSoftInput(edit, 0);
}

From source file:Main.java

public static void showSoftInput(Activity acitivity, EditText et) {
    if (et == null)
        return;//w w  w . jav a 2  s. co  m
    et.requestFocus();
    InputMethodManager imm = (InputMethodManager) et.getContext()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.showSoftInput(et, InputMethodManager.RESULT_UNCHANGED_SHOWN);

}

From source file:Main.java

public static void showSoftKeyboard(Context context, View view) {
    InputMethodManager inputMethodManager = (InputMethodManager) context
            .getSystemService(Activity.INPUT_METHOD_SERVICE);
    inputMethodManager.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
}

From source file:Main.java

public static void showKeyboard(Activity _activity, View _view) {
    InputMethodManager inputMethodManager = (InputMethodManager) _activity
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    inputMethodManager.showSoftInput(_view, 0);
}

From source file:Main.java

public static void showSoftInput(Context context, final EditText et) {
    if (context == null || et == null) {
        return;//from ww w  .j  a v a2 s.  c o  m
    }
    InputMethodManager imm = (InputMethodManager) et.getContext()
            .getSystemService(Context.INPUT_METHOD_SERVICE);

    imm.showSoftInput(et, InputMethodManager.SHOW_FORCED);
}

From source file:Main.java

public static void showSoftKeyborad(Activity context, EditText et) {
    if (context == null)
        return;/*  w  w  w. j  a va 2 s .  c  o m*/
    InputMethodManager inputMethodManager = (InputMethodManager) context
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    inputMethodManager.showSoftInput(et, InputMethodManager.SHOW_FORCED);
}

From source file:Main.java

@TargetApi(Build.VERSION_CODES.CUPCAKE)
public static void showSoftInput(Context context, EditText edit) {
    edit.setFocusable(true);/*from   www .  ja  v  a  2 s.  co m*/
    edit.setFocusableInTouchMode(true);
    edit.requestFocus();
    InputMethodManager inputManager = (InputMethodManager) context
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    inputManager.showSoftInput(edit, 0);
}

From source file:Main.java

public static void showImm(Context context, View view) {
    if (null == context) {
        return;//from w ww .  j ava 2  s .co  m
    }
    if (view != null) {
        InputMethodManager imm = ((InputMethodManager) (context
                .getSystemService(Context.INPUT_METHOD_SERVICE)));
        imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
    }
}

From source file:Main.java

public static void showInput(EditText editText) {
    InputMethodManager inputManager = (InputMethodManager) editText.getContext()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    inputManager.showSoftInput(editText, 0);
}

From source file:Main.java

public static void openSoftInput(EditText et) {
    InputMethodManager inputMethodManager = (InputMethodManager) et.getContext()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    inputMethodManager.showSoftInput(et, InputMethodManager.HIDE_NOT_ALWAYS);
}