如何在我的应用程序中不断检查Internet连接并在连接不可用时作出响应?
目前我使用的是:
while(true) { if(HasConnection()) { //doSomething.. } //stop app by 1sec }
但似乎不太雅致。