+ Configuration cf = activity.getResources()
+ .getConfiguration();
+ if (cf.keyboard == Configuration.KEYBOARD_NOKEYS ||
+ cf.keyboardHidden == Configuration.KEYBOARDHIDDEN_YES)
+ activity.getWindow()
+ .setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);