title: android check visibility of button after on click
body: <p>when i click a button i call a function that make button invisible when i am connecting to server. the problem i cannot check if the visibility of the button has been modified.</p>
  
  <pre><code> login_btn.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
  
                  socket.connect();
                  if (login_btn.getVisibility() == View.VISIBLE) {
                      Clink.show(EspacePersonnelActivity.this, "veuillez verifier les parametres de connexion");
  
                  }
              }
  
          });
  </code></pre>
  
  <p>after socket.connect if i receive this event</p>
  
  <pre><code> //Réception message
          socket.on("EVT_ReponseOKConnexionZEP", new Emitter.Listener() {
  
              @Override
              public void call(final Object... args) {
  
                  String data = (String) args[0];
                  Log.i("message :", data);
                  runOnUiThread(new Runnable() {
                      @Override
                      public void run() {
                          zepLayout.setBackgroundResource(R.drawable.rounded_corner_green);
                          logout_btn.setVisibility(View.VISIBLE);
                          login_btn.setVisibility(View.GONE);
  
                      }
                  });
  
              }
  
  
          });
  </code></pre>
  
  <p>the problem is login_btn is visible before clicking, and the codition always return true.
  i want to check if button is always visible or not after clicking on it.</p>