+ public static void showSoftKeyboard(Activity activity) {
+ // make the keyboard appear
+ Configuration cf = activity.getResources()
+ .getConfiguration();
+ if (cf.keyboardHidden == Configuration.KEYBOARDHIDDEN_YES)
+ activity.getWindow()
+ .setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
+ }
+ public static void showSoftKeyboard(Fragment fragment) {
+ showSoftKeyboard(fragment.getActivity());
+ }