Code example for InputMethodManager

Methods: isActivetoggleSoftInput

0
public class ActivityUtils { 
 
    public static final void hideInput(Activity activity) {
        InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
        //�õ�InputMethodManager��ʵ�� 
        if (imm.isActive()) {
            //�������� 
            imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, InputMethodManager.HIDE_NOT_ALWAYS);
            //�ر������̣����𷽷���ͬ�����򷽷����л��������ر�״̬�� 
        } 
    } 
}