Okhttp3 onFailure检测
我输入OKHTTP(OKHTTP3)以从服务器检索数据。如果从服务器检索信息的过程以“ onfailure”结尾,我想澄清为什么该过程以“ onfailure”结束。我如何确定域是否与服务器断开(服务器为下降,域没有服务器)或用户的Internet打开?在启动OKHTTP3之前,如何在onfailure上进行此操作,而不是在互联网上检查Internet,然后启动OKHTTP3进程?我想相应地发出相应的敬酒消息。
onfailure:
client.newCall(request).enqueue(new Callback () {
@Override
public void onFailure (Call call, IOException e) {
e.printStackTrace ();
}
如何:
- 互联网不起作用
- 域问题
- 。 我可以诊断onfailure中的问题并显示相应的对话框?
I entered Okhttp (okhttp3) to retrieve data from the server. If the process of retrieving information from the server ends with "onFailure", I want to clarify why the process ends with "onFailure". How can I find out if the domain is disconnected from the server (the server is down‚ the domain is without a server) or the user's Internet is on? How can I do this on onFailure instead of checking the internet before starting okhttp3 and then starting the okhttp3 process? I want to issue a corresponding Toast message accordingly.
onFailure:
client.newCall(request).enqueue(new Callback () {
@Override
public void onFailure (Call call, IOException e) {
e.printStackTrace ();
}
how to:
- The internet doesn't work
- Domain problem
- other...
Can I diagnose problems in onFailure and show a corresponding dialog?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论