Example usage for android.view.inputmethod InputMethodManager SHOW_IMPLICIT

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

Introduction

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

Prototype

int SHOW_IMPLICIT

To view the source code for android.view.inputmethod InputMethodManager SHOW_IMPLICIT.

Click Source Link

Document

Flag for #showSoftInput to indicate that this is an implicit request to show the input window, not as the result of a direct request by the user.

Usage

From source file:Main.java

/**
 * Toggle Soft Input.//w  w  w.  j  ava2 s.c o m
 * @param context
 */
public static void toggleSoftInput(Context context) {
    InputMethodManager inputManager = (InputMethodManager) context
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    inputManager.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, InputMethodManager.HIDE_IMPLICIT_ONLY);
}

From source file:Main.java

public static void showInputMethodWindow(Activity activity, View view) {
    try {/*  w w w.  ja  va  2  s .c o m*/
        ((InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(view,
                InputMethodManager.SHOW_IMPLICIT);
    } catch (Throwable th) {
        th.printStackTrace();
    }
}

From source file:Main.java

public static void showSoftKeyboard(Context context, View view) {
    if (view.requestFocus()) {
        InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
    }//  w w  w.j a v  a 2s.  c om
}

From source file:Main.java

public static void showSoftKeyboard(View view) {
    Context context = view.getContext();
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    view.requestFocus();//from ww w.  jav  a2 s  . c  o m
    if (imm != null) {
        imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
    }
}

From source file:Main.java

public static void showSoftKeyboard(View view) {
    Context context = view.getContext();
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    view.requestFocus();/*  w ww.j ava2 s .c o  m*/
    imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
}

From source file:Main.java

public static void show(Activity activity, EditText editText) {
    editText.requestFocus();//from www. ja  v a  2  s . com
    editText.requestFocusFromTouch();
    InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
}

From source file:Main.java

public static void showInputMethodWindow(Activity activity, View view) {
    try {//  w  w w. j  av  a2 s  . c  om
        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 popSoftKeyboard(Context context, View view, boolean isShow) {
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    if (isShow) {
        view.requestFocus();//  w  w  w.  ja  va 2 s .  co  m
        imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
    } else {
        imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
    }
}

From source file:Main.java

public static void showImm(Context context, View view) {
    if (null == context) {
        return;// w  ww.  ja va  2s .c  o  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 showKeyboard(View view) {
    if (view == null) {
        return;/*from   ww w . j  av a  2s . c o m*/
    }
    InputMethodManager imm = (InputMethodManager) view.getContext()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    if (!imm.isActive()) {
        return;
    }
    imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
}