I meet a problem.when i login my app(from login page to home page),there is no any editable widgets in home page,but the keyboard pops up automatically which i dont want to , how to fix it? thanks
            Asked
            
        
        
            Active
            
        
            Viewed 124 times
        
    2 Answers
1
            
            
        From Close/hide the Android Soft Keyboard:
You can force Android to hide the virtual keyboard using the InputMethodManager, calling hideSoftInputFromWindow, passing in the token of the window containing your edit field.
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);This will force the keyboard to be hidden in all situations. In some cases you will want to pass in
InputMethodManager.HIDE_IMPLICIT_ONLYas the second parameter to ensure you only hide the keyboard when the user didn't explicitly force it to appear (by holding down menu).
 
    
    
        Community
        
- 1
- 1
0
            
            
        Try this.
InputMethodManager inputManager = (InputMethodManager) (YourActivity)
                            .getSystemService(Context.INPUT_METHOD_SERVICE);
                    inputManager.hideSoftInputFromWindow(home.getCurrentFocus()
                            .getWindowToken(),
                            InputMethodManager.HIDE_NOT_ALWAYS);
 
    
    
        san
        
- 1,845
- 13
- 23
