title: Retrofit.Callback's success() and failure() in case of two interface implementations in same Activity
body: <p>I am currently writing an app that connects to a server to make POST requests. For this reason, I have created multiple Retrofit interfaces for various network operations. I have one that performs registration: I take the username, e-mail etc, make a POST request and then as a final parameter I have a Callback (RegistrationResult is a POJO that accepts "success" or "failure" in a class variable). This interface looks like this:</p>
  
  <pre><code>public interface RegistrationInterface {
  
      @FormUrlEncoded
      @POST("/api/apiregistration.php")
      void connect(@Field("country") String country,
              @Field("state") String state, @Field("email") String email, 
              @Field("pwd") String password,
              Callback&lt;RegistrationResult&gt; resp);
  
  }
  </code></pre>
  
  <p>Now, because I'm going to use GCM for push notifications, I have another interface that sends the registration id of the particular device to the server and, again, gets a response back. That interface looks like this:</p>
  
  <pre><code>public interface SendRegIDInterface {
  
      @FormUrlEncoded
      @POST("/api/apiregid.php")
      void connect(@Field("reg_id") String reg_id,
  
      Callback&lt;RegIDResult&gt; resp);
  
  }
  </code></pre>
  
  <p>So far, so good. The problem arises when I try to create implementations of both interfaces in the same class. Let's say I have an Activity that, for some reason, should use implementations from both interfaces. So I have this:</p>
  
  <pre><code>public class MessageActivity extends Activity implements Callback {
  
   public void onCreate(Bundle firebug) {
  
   RestAdapter restAdapter1 = new RestAdapter.Builder().setEndpoint(endpoint).build();
   RegistrationInterface regInter = restAdapter1.create(RegistrationInterface.class);
   regInter.connect(// parameters here, MessageActivity.this);
  
   RestAdapter restAdapter2 = new RestAdapter.Builder().setEndpoint(endpoint).build();
   SendRegIDInterface regIDInter = restAdapter2.create(SendRegIDInterface.class);
   regIDInter.connect(reg_id, MessageActivity.this); 
  
  
  
    }
  
  
  
  
  @Override
      public void failure(RetrofitError arg0) {
  
      }
  
      @Override
      public void success(Object arg0, Response arg1) {
  
  }
  
  }
  </code></pre>
  
  <p>My problem is this: where do the overridden methods (failure and success) of the Retrofit.Callback interface correspond? Since I'm having two implementations of Retrofit interfaces in the same Activity, how can I distinguish what gets returned in, eg. the success() method?  Is it the response from the RegistrationInterface implementation or the response from the SendRegIDInterface that's contained in the Callback's success() method's arguments? As long as I only had an implementation of the RegistrationInterface interface in the Activity, everything was clear: the success() method's arguments contain the server's response to the registration request. Now that I'm using a second interface implementation (SendRegIDInterface) I'm super-confused!</p>
  
  <p>Or am I going completely wrong about this?</p>