When you start the application (in the absence of the Internet) writes an error:

net :: ERR_INTERNET_DISCONNECTED

Immediately there is an opportunity to repeat or close the window. How to override this error? Let's say to write the text: "There is no internet connection. Repeat the connection later."

If this helps, then I’ll clarify: the error appears when you run the VKSdk.login () method from the VK.com for android library.

    1 answer 1

    It all depends on your further actions if there is no connection. Catching errors is nice, but here is a clear example of when you should take into account the state of the network, and in one of them, do not disturb your method. An example from the dock :

    ConnectivityManager cm = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); boolean isConnected = activeNetwork.isConnectedOrConnecting(); if (isConnected) VKSdk.login(); else System.out.println("Подключение к интернету отсутствует. Повторите подключение позже");