code: public void logoutAndClearState() {
          if (client != null && client.isConnected()) {
              logout();
              client.disconnect();
          }
          activity = null;
          client = null;
      }
docs: Clears this helper state. After this method is called the provider should not be used.