package com.danding.yang800.Reciver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;

import com.danding.yang800.BaseActivity;
import com.danding.yang800.General.Yang800App;
import com.danding.yang800.Util.NetUtil;

public class NetBroadCastReciver extends BroadcastReceiver {
    public NetEvevt evevt = BaseActivity.evevt;

    /**
     * 只有当网络改变的时候才会 经过广播。
     */

    @Override
    public void onReceive(Context context, Intent intent) {
        int netWorkState = NetUtil.getNetWorkState(context);
        evevt.onNetChange(netWorkState);
    }

    public interface NetEvevt {
        public void onNetChange(int netMobile);
    }
}
