Android examples for android.view.inputmethod:KeyBoard
toggle Soft Input
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;// w w w .j a v a2 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); } } }