package com.sabirjan.liulanqi.Wangluo;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class JianChaWangLuo {
	
	
	public static boolean CheckNet(Context context)
	{
		try
		{
			ConnectivityManager conn=(ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
			if(conn!=null)
			{
				//��ȡ����l�ӵĹ������
				NetworkInfo info=conn.getActiveNetworkInfo();
				if(info!=null&&info.isConnected())
				{
					if(info.getState()==NetworkInfo.State.CONNECTED)
					{
					return true;
					}
				}
			}
		}
		catch(Exception ex)
		{
			
		}
		return false;
	}
}
