How can I tell the difference between wrong URL (wrong server address) and offline network? In both cases I get communication VolleyError which is "instanceof NoConnectionError" and "instanceof NetworkError"
thanks
How can I tell the difference between wrong URL (wrong server address) and offline network? In both cases I get communication VolleyError which is "instanceof NoConnectionError" and "instanceof NetworkError"
thanks
I finally solved it by asking this:
public static boolean isNetworkAvailable() {
ConnectivityManager connectivityManager = (ConnectivityManager)
mCtx.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfoconnectivityManager
.getActiveNetworkInfo();
return activeNetworkInfo != null &&
activeNetworkInfo.isConnected();
}