package com.gh.gamecenter.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.gh.common.util.NetworkUtils;
import com.gh.gamecenter.eventbus.EBNetworkState;

import de.greenrobot.event.EventBus;

public class NetworkStateReceiver extends BroadcastReceiver {

	// 监听网络状态的变化
	@Override
	public void onReceive(Context context, Intent intent) {
		
		EventBus.getDefault().post(
				new EBNetworkState(NetworkUtils
						.isNetworkConnected(context)));
	}

}
