//注册网络监听 IntentFilter filter = new IntentFilter(); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); registerReceiver(mNetworkStateReceiver, filter); //在Activity中的onDestroy中:' unregisterReceiver(mNetworkStateReceiver); //取消监听
Android 监控网络状态(2)
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:http://127.0.0.1/wywydy.html