如果你想在代码中控制软键盘,可以使用InputMethodManager来调用它并将其关闭。getSystemService()是Activity的一个调用。 InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(activeView, 0);