You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package com.rehome.sbcksyy.base ;
import android.content.Context ;
import android.widget.Toast ;
import retrofit2.Call ;
import retrofit2.Callback ;
import retrofit2.Response ;
/**
* Created by Rehome-rjb1 on 2017/5/17.
* 请求数据的封装, 封装了一个dialog
*/
public abstract class BaseCallBackNoProgress < T > implements Callback < T > {
private final Context context ;
public BaseCallBackNoProgress ( Context context ) {
this . context = context ;
}
@Override
public void onResponse ( Call < T > call , Response < T > response ) {
onSuccess ( call , response ) ;
}
@Override
public void onFailure ( Call < T > call , Throwable t ) {
Toast . makeText ( context , "网络连接失败" , Toast . LENGTH_SHORT ) . show ( ) ;
onError ( call , t ) ;
}
public abstract void onSuccess ( Call < T > call , Response < T > response ) ;
public abstract void onError ( Call < T > call , Throwable t ) ;
}