show Keyboard - Android android.view.inputmethod

Android examples for android.view.inputmethod:InputMethodManager

Description

show Keyboard

Demo Code

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

public class Main {

  public static void showKeyboard(Activity activity, View view) {
    try {/*from  ww  w .java2 s. c o m*/
      InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
      if (imm != null) {
        imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
      }
    } catch (Exception e) {
    }
  }

}

Related Tutorials