I have these few lines of code to validate form input. However, it doesn't output anything - just a blank box. What am I missing, please?
 public void onClick(View view)
 {
    if( view.getId() == R.id.btnLogin )
    {
        TestClass.setUsername( txtUserName.getEditableText().toString() );
        TestClass.setPassword( txtPassword.getEditableText().toString() );
        if( TestClass.getUsername().toString().length() == 0 )
        {
            this.txtUserName.setError( "Incorrect input!" );
        }
        else if( TestClass.getPassword().toString().length() == 0 )
        {
         this.txtPassword.setError( "Incorrect input!" );
        }
        else
        {
               // do the login stuff here
        }
     } 
  }