Android examples for User Interface:Input Method
toggle Soft Input
//package com.java2s; import android.content.Context; import android.view.View; import android.view.inputmethod.InputMethodManager; public class Main { public static void toggleSoftInput(Context context, View view, boolean shouldShow) { if (context == null) { return; }/*from w ww . j a v a 2 s . c o m*/ InputMethodManager im = (InputMethodManager) context .getSystemService(Context.INPUT_METHOD_SERVICE); if (shouldShow) { im.showSoftInput(view, InputMethodManager.SHOW_FORCED); } else { im.hideSoftInputFromWindow(view.getWindowToken(), 0); } } }