@SuppressLint(“MissingPermission”)
private void ConManager() {
ConnectivityManager manager= (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = manager.getActiveNetworkInfo();
if(activeNetworkInfo!=null){
Toast.makeText(this, “有网”, Toast.LENGTH_SHORT).show();
MyAdapter myAdapter=new MyAdapter(list,MainActivity.this);
show_list.setAdapter(myAdapter);
}else{
Toast.makeText(this, "没网", Toast.LENGTH_SHORT).show();
}
}