private boolean hasActivityNetwork(){
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return activeNetworkInfo!=null && activeNetworkInfo.isAvailable();
}
//判断是否有网络
最新推荐文章于 2020-02-06 15:48:01 发布