final boolean isInternetOn() {CONNECTIVITY_SERVICE);// ARE WE CONNECTED TO THE NET
if ( connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED ||CONNECTING ||CONNECTING ||CONNECTED ) {// MESSAGE TO SCREEN FOR TESTING (IF REQ)
//Toast.makeText(this, connectionType + ” connected”, Toast.LENGTH_SHORT).show();
return true;else if ( connec.getNetworkInfo(0).getState() == NetworkInfo.State.DISCONNECTED || connec.getNetworkInfo(1).getState() == NetworkInfo.State.DISCONNECTED ) {//System.out.println(“Not Connected”);
return
false ;
return
false;
connec.getNetworkInfo(0).getState() == NetworkInfo.State.
connec.getNetworkInfo(1).getState() == NetworkInfo.State.
connec.getNetworkInfo(1).getState() == NetworkInfo.State.
}
false ;
}
false;
}
ConnectivityManager connec = (ConnectivityManager)getSystemService(Context.
No comments:
Post a Comment