Hi I’m using this snippet from android
public boolean isOnline() {
ConnectivityManager connMgr = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
return (networkInfo != null && networkInfo.isConnected());
}
But when I interrupt the internet connection from my desktop it won’t find that isn’t connected,and try to connect. I’m running it in the Android emulator. My question:why it won’t return false and still figures out that it is connected?if it was connected through 3D shouldn’t it get the data?
1 Answer