- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {LocalDateTime l =
new LocalDateTime()
LocalDateTime.now()
DateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
- Smart code suggestions by Codota
}
@Override public void onException(Throwable throwable) { callback.onException(throwable); endTime = System.currentTimeMillis(); destroy(); }
@Override public boolean onRedirect(HttpResponse response) { endTime = System.currentTimeMillis(); return callback.onRedirect(response); }
@Override public void run(Timeout timeout) throws Exception { if (tryDone()) { if (callback != null) { callback.onTimeout(); } } }
private void call(String method, String url, final HttpCallback cb) { ... client.newCall(request).enqueue(new Callback() { Handler mainHandler = new Handler(context.getMainLooper()); @Override public void onFailure(Request request,final Throwable throwable) { mainHandler.post(new Runnable() { @Override public void run() { cb.onFailure(null, throwable); } }); } @Override public void onResponse(final Response response) throws IOException { mainHandler.post(new Runnable() { @Override public void run() { if (!response.isSuccessful()) { cb.onFailure(response, null); return; } cb.onSuccess(response); } }); } }); }
@Override public void onFailure(int statusCode, String reasonPhrase) { callback.onFailure(statusCode, reasonPhrase); endTime = System.currentTimeMillis(); destroy(); }
@Override public void onResponse(HttpResponse response) { callback.onResponse(response); endTime = System.currentTimeMillis(); destroy(); }
@Override public void onTimeout() { callback.onTimeout(); endTime = System.currentTimeMillis(); destroy(); }