title: How can I change a class to an interface in this condition?
body: <p>Here is my definition：</p>
  
  <pre><code>public abstract class APICallback&lt;T extends CommonModel.APIDataModel&gt; implements Callback&lt;CommonModel&lt;T&gt;&gt; 
  </code></pre>
  
  <p>I found that I can not convert APICallback back to Callback.</p>
  
  <p>What is the problem?</p>
  
  <p>How can I do it correctly?</p>
  
  <p>Thank you!</p>
  
  <p>----Update----</p>
  
  <p>In fact I am using <a href="http://square.github.io/retrofit/" rel="nofollow">retrofit</a>, I defined <code>APICallback</code> implements <code>retrofit.Callback</code></p>
  
  <p>Here is the exact code :</p>
  
  <pre><code>public abstract class APICallback&lt;T extends CommonModel.APIDataModel&gt; implements Callback&lt;CommonModel&lt;T&gt;&gt; {
  private Context context;
  
  public APICallback(Context context) {
      this.context = context;
  }
  
  public abstract void onResponse(T response);
  
  @Override
  public void onResponse(Response&lt;CommonModel&lt;T&gt;&gt; response, Retrofit retrofit) {
      T data = response.body().data;
  
      if (response.body().isSuccess()) {
          onResponse(data);
          onEnd();
      } else {
          dispatchError(response.body());
      }
  }
  
  @Override
  public void onFailure(Throwable t) {        
      LogUtils.d("Network error or exception", t.getMessage());
      ViewUtils.showMessage(t.getMessage());
      onEnd();
  }
  
  public void dispatchError(CommonModel&lt;T&gt; response) {   
      LogUtils.d("API error", response.toString());
      ViewUtils.showMessage(response.data.msg);
      onEnd();
  }
  
  public void onEnd() {
      if (context instanceof BaseActivity) {
          ((BaseActivity) context).getLoading().hide();
      }
  }
  </code></pre>
  
  <p>I am using it like this: </p>
  
  <pre><code>getClient().login(u, p).enqueue(new APICallback&lt;UserModel&gt;(this) {
          @Override
          public void onResponse(UserModel response) {
  
              Intent intent = new Intent(LoginActivity.this, MainActivity.class);
              startActivity(intent);
              finish();
          }
  
      });
  </code></pre>
  
  <p>enqueue :</p>
  
  <pre><code>void enqueue(Callback&lt;T&gt; callback);
  </code></pre>
  
  <p>login :</p>
  
  <pre><code>Call&lt;UserModel&gt; login(@Field("user_name") String userName, @Field("user_password") String userPassword);
  </code></pre>
  
  <p>The compiler tell me that can not convert anonymous <code>APICallback&lt;UserModel&gt;</code> to <code>Callback&lt;UserModel&gt;</code></p>
  
  <p>I am confused.</p>