title: kotlin: How to get if EditText has setError enabled?
body: <p>How can I validate if EditText has setError enabled ?</p>
  
  <p>I want to disable a button if EditText has an error.</p>
  
  <p>Any other way to achieve this.</p>
  
  <p>It kinda works when I put <code>view.calcbutton.setEnabled(false)</code> inside the validateEditText-function, but I use the validateEditText-function to validate multiple EditTexts and only the last function-call disables the button.
  if the first function-call disables the button, the second enables it again, and vice versa.</p>
  
  <p>But I want do it outside this function because if one of the multiple EditTexts has setError the button should be disabled.</p>
  
  <pre><code>//global var blockcalcbutton
  var blockcalcbutton = 0
  
  //function to validate EditTexts and set blockcalcbutton=1 if setError
  validateEditText(view.input_volt, view, getString(R.string.invalid_volt))
  
          if(blockcalcbutton == 1) {
              view.calcbutton.setEnabled(false)
              view.calcbutton.setText(getString(R.string.calcbutton_disabled))
              view.calcbutton.setBackgroundResource(R.color.buttonDisabled)
          } else {
              view.calcbutton.setEnabled(true)
              view.calcbutton.setText(getString(R.string.calcbutton_enabled))
              view.calcbutton.setBackgroundResource(R.color.buttonBackground)
          }
  </code></pre>
  
  <pre><code>fun validateEditText(editText: EditText, message: String) {
          val myEditText = editText
          myEditText.addTextChangedListener(object: TextWatcher {
              override fun afterTextChanged(s: Editable?) {
  
                  if(myEditText.text.toString() == "" || myEditText.text.toString() == "." || myEditText.text.toString() == "0") {
                      //setError
                      myEditText.setError(message)
                      //var to disable Button 
                      blockcalcbutton = 1
                  } else {
                      //delete setError
                      myEditText.setError(null)
                      //var to enable Button
                      blockcalcbutton = 0
                  }
              }
  </code></pre>