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, ResultReceiver resultReceiver) 

Source Link

Document

Explicitly request that the current input method's soft input area be shown to the user, if needed.

Usage

From source file:com.ada.utils.Ui.java

public static void showSoftkeyboard(View view, ResultReceiver resultReceiver) {
    Configuration config = view.getContext().getResources().getConfiguration();
    if (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES) {
        InputMethodManager imm = (InputMethodManager) view.getContext()
                .getSystemService(Context.INPUT_METHOD_SERVICE);

        if (resultReceiver != null) {
            imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT, resultReceiver);
        } else {//from   ww w  .j av a2 s .c om
            imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
        }
    }
}