title: how to use invoke on HubProxy signalr android
body: <p>I'm new to <code>SignalR</code> library and the lack of documentation on <a href="https://www.asp.net/signalr" rel="nofollow noreferrer">Microsoft's website</a> in <code>Android</code> doesn't really help. I'm trying to invoke a method on the server using this code:</p>
  
  <pre><code>mHubProxy.invoke("method", "params...").done(new Action&lt;Void&gt;() {
          @Override
          public void run(Void aVoid) throws Exception {
  
          }
      });
  </code></pre>
  
  <p>But the result from the server isn't <code>void</code> and changing <code>Action&lt;Void&gt;</code> to <code>&lt;Object&gt;</code> gives an error. <strong>How do I get a response from <code>invoke</code> that isn't void?</strong></p>
  
  <p>The init part:</p>
  
  <pre><code>Platform.loadPlatformComponent(new AndroidPlatformComponent());
      String serverUrl = "server";
      mHubConnection = new HubConnection(serverUrl);
      String SERVER_GET_TOKEN = "name";
      mHubProxy = mHubConnection.createHubProxy(SERVER_GET_TOKEN);
      ClientTransport clientTransport = new ServerSentEventsTransport(mHubConnection.getLogger());
      Credentials credentials = new Credentials() {
          @Override
          public void prepareRequest(Request request) {
              request.addHeader("Authorization", token);
          }
      };
      mHubConnection.setCredentials(credentials);
      SignalRFuture&lt;Void&gt; signalRFuture = mHubConnection.start(clientTransport);
  
      try {
          signalRFuture.get();
      } catch (InterruptedException | ExecutionException e) {
          Log.e("SimpleSignalR", e.toString());
          return;
      }
  </code></pre>