like enqueue();, enqueue(null) or enqueue(EmptyCallback).. etc, whatever.
i need executing request and not handling any response job.
i'm using below code at that case:
api.sendLastPosition(38.f, 127.f).enqueue(new Callback<Void>() {
@Override
public void onResponse(Response<Void> response, Retrofit retrofit) {
}
@Override
public void onFailure(Throwable t) {
}
});
Yes, may be my request feature is unnecessary. so, what code should i using in this case?
@devflow You could create a simple class that implements Retrofit Callback's interface:
public class EmptyCallback<T> implements Callback<T> {
@Override
public void success(T t, Response response) { }
@Override
public void failure(RetrofitError error) { }
}
and then just:
api.sendLastPosition(38.f, 127.f).enqueue(new EmptyCallback<>());
@michaldrabik
Thanks. How did i miss that :sob: .. thanks again.
Most helpful comment
@devflow You could create a simple class that implements Retrofit Callback's interface:
and then just:
api.sendLastPosition(38.f, 127.f).enqueue(new EmptyCallback<>());