阅读背景:

如果在Android上拒绝连接,则显示消息

来源:互联网 

I'm currently developing an Android application that requires HTTP connection. I'm using a physical device to test my app. If the wireless connection on my device is not turned on and I start the application it will obviously crash telling me "Unfortunately, My Application has stopped." . And then there's this stack trace telling me the connection to my URL was refused. So far so good. Now, what I need is for my application to not crash when I don't have internet connection on my device, but instead, I want it to show a dialog and keep the application running. I am also using Json.I'm currently developing an Android application




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: