title: How to check EditText isEmpty in Android
body: <p>I want to create a <strong>login page</strong>, I used <code>EditText</code> to insert user info. I want to check <code>EditText</code> to see if it is Empty <strong>Invisible</strong> login Button, when inserted any character with user <strong>visible</strong> Login Button.<br>
  I tried the code shown below, but it did not not work for me : </p>
  
  <pre><code>//Show Login Button
  String login_phoneString = login_PhoneText.getText().toString().trim();
  if (login_phoneString.isEmpty()) {
      login_image.setVisibility(View.INVISIBLE);
  } else {
      login_image.setVisibility(View.VISIBLE);
  }
  </code></pre>
  
  <p>When <code>EditText</code> is empty, the button is invisible, and when set character in <code>EditText</code> again the login button is not shown. </p>
  
  <p>How can I fix this problem ?</p>