Code example for InputMethodManager

Methods: toggleSoftInput

0
    public void onPause() 
    { 
    	super.onPause(); 
    	// Ugly solution to hide the soft keyboard by forcing it to show first, then toggle it 
    	InputMethodManager inputManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
    	inputManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 
    			InputMethodManager.HIDE_IMPLICIT_ONLY); 
    	inputManager.toggleSoftInput(0, 0);
    } 
     
    protected void performLogin() { 
		final ProgressDialog dialog = new ProgressDialog(UserView.this);
		dialog.setMessage("Login...");
	    dialog.show();
	     
    	String login = ((EditText) findViewById(R.id.email_address)).getText().toString();
    	String password = ((EditText) findViewById(R.id.pw)).getText().toString();
    	String errorMsg = null;
    	try { 
	    	HashMap<String, Object> dataMap = new HashMap<String, Object>();
	    	dataMap.put("login", login);