Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.content.res.Configuration; import android.view.View; import android.view.inputmethod.InputMethodManager; public class Main { public static void softKeyboardDelayed(final View view) { view.post(new Runnable() { @Override public void run() { if (!isHardwareKeyboardAvailable(view.getContext())) { InputMethodManager imm = (InputMethodManager) view.getContext() .getSystemService(Context.INPUT_METHOD_SERVICE); if (imm != null) { imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); } } } }); } /** * @param context * @return true if Hardware keyboard is available */ public static boolean isHardwareKeyboardAvailable(Context context) { return context.getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS; } }