android - Okhttp infinite loop on change connection status -
i have simple code making request okhttp lib: request request = new request.builder() .url(url) .build(); log.d("tag", "start"); response response = httpclient.newcall(request).execute(); log.d("tag", "stop"); everything works well, unless try change connection, while execute request. ex, if try connect without wifi (with slow internet connection), , turn on wifi while it's in progress execute infinitely. if stay slow mobile internet or stay wifi (without changing connection type) works fine. same story when turn off connections, start execution , turn on connection. tried use timeout, doesn't help. edit. there no other valuable code: private class downloadxmltask extends asynctask<string, void, void> { private asynccallback<reader> callback; private downloadxmltask(asynccallback<reader> callback) { this.callback = callback; } @override p...