/FileExtraction/Java_unseen/tianyuan168326_nono-android/app/src/main/java/com/seki/noteasklite/broadcastreceiver/NetWorkReceiver.java
package com.seki.noteasklite.broadcastreceiver;

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

import com.seki.noteasklite.MyApp;
import com.seki.noteasklite.Util.NetWorkUtil;


public class NetWorkReceiver extends BroadcastReceiver
{

	@Override
	public void onReceive(Context context, Intent intent) {
		// TODO Auto-generated method stub
		if(!NetWorkUtil.isNetworkAvailable(context))
		{
			MyApp.getInstance().netWorkState = 0;
		}
		else if(NetWorkUtil.isWifi(context))
		{
			MyApp.getInstance().netWorkState =2;
		}
		else {
			MyApp.getInstance().netWorkState =1;
		}
	}
	
}