I received a bug yesterday, which is described as follows: 1 Enter Settings --> Language & input2 Choose personal dictionary3.Choose add in menu4.Input some word and choose personal dictionary [Expected result] The word can be added to dictionary and no any error [Error] The input panel can't hide enter add user dictionary, edit and exit, however, the input panel cannot be automatically hidden. This issue involves the concept of fragment. For more information about the concept of fragment, see http://www.cnblogs.com/mybkn/articles/2455134.html. The user dictionary is added in UserDictionaryAddWordFragment. UserDictionaryAddWordFragment inherits from Fragment. \ Packages \ apps \ Settings \ src \ com \ android \ settings \ inputmethod \ UserDictionaryAddWordFragment. java adds the following code in its onPause () method: boolean autoHide = getResources (). getBoolean (R. bool. auto_hide_keyboard_when_onpause); if (autoHide) {www.2cto.com ContexttContext = getActivity (); InputMethodManager imm = (InputMethodManager) getActivity (). getSystemService (tContext. INPUT_METHOD_SERVICE); imm. hideSoftInputFromWindow (GetActivity (). getCurrentFocus (). getWindowToken (), 0);} R. bool. auto_hide_keyboard_when_onpause bool value under \ packages \ apps \ Settings \ res \ value. it is defined in xml. The value of smart-phone is false, and the value in bool. xml under the value-sw600dp directory is true. The onPause method of Fragment is called when this Fragment is invisible. Therefore, you can add this code to the onPause method to automatically hide the input method interface when exiting this Fragment.