/ Published in: Java
Need to check if your device is online before sending/getting a request? Here's how.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public boolean isOnline() { return cm.getActiveNetworkInfo().isConnectedOrConnecting(); }