Skip to content

Checking For Network Errors

mnipper edited this page Feb 11, 2014 · 1 revision

All networking code must happen on a background thread. Before any networking is attempted, you should check for network errors so that the appropriate notifications can be displayed to the user. As an example:

    if (NetworkNotificationUtils.checkForNetworkErrors(context)) {
        doSomeStuff();
    }

Note: NetworkNotificationUtils.checkForNetworkErrors(Context) must be called on a background thread, since it pings the server.

Clone this wiki locally