<EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:ems="10" android:inputType="text" android:imeOptions="actionDone"> <requestFocus /> </EditText>
InputMethodManager imm = (InputMethodManager) mActivity.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(XXX.getWindowToken(), 0);
参考:http://blog.csdn.net/liuxiit/article/details/6903884