How can I set connection timeout for OkHttpClient? 2017
问题 It is easy to say it's duplicate but it isn't. I read many post about how to set the connection timeout in android but the post are 4-7 years old and I think that we all need an update about this topic because those methods are deprecated or no longer exist. So the question is how can I set my connection timeout when I am waiting for a response from the server? final Response response = httpClient.newCall(request).execute(); if (response.isSuccessful()) { //success } else { //unsuccessful }