Show Keyboard : Key « User Event « Android






Show Keyboard

    

import android.content.Context;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;

class Main {
  public static void showKeyboard(final Context context, final EditText input) {
    // Never explicitly open soft keyboard if physical keyboard is present

    input.post(new Runnable() {
      public void run() {
        InputMethodManager imm = (InputMethodManager) context
            .getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.showSoftInput(input, InputMethodManager.SHOW_FORCED);
      }
    });

  }

}

   
    
    
    
  








Related examples in the same category

1.Key event listener
2.Example of writing an input method for a soft keyboard.
3.Soft keyboard get Char
4.show hide virtual keyboard
5.has Physical Keyboard
6.Hide Keyboard
7.intrepret Direction Key