摘要:
第一种是使用广播实现对网络的监听 1 //对网络监听的广播 2 public class ConnectionChangeReceiver extends BroadcastReceiver { 3 @Override 4 public void onReceive(Context context, Intent intent) { 5 ConnectivityManager cm=(ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); 6 ... 阅读全文