public boolean isOnline() { ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); return cm.getActiveNetworkInfo().isConnectedOrConnecting(); }
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/10431.html