Code example for NetworkInfo

Methods: getState, getType

0
	 * @return Type of network. <code>null</code> if network is 
	 *         <code>null</code> or it is not connected and is not suspended. 
	 */ 
	private Integer getType(NetworkInfo networkInfo) {
		if (networkInfo != null
				&& (networkInfo.getState() == State.CONNECTED || networkInfo
						.getState() == State.SUSPENDED))
			return networkInfo.getType();
		return null; 
	} 
 
	/** 
	 * @param networkInfo 
	 * @return <code>true</code> if network is not <code>null</code> and is 
	 *         suspended. 
	 */ 
	private boolean isSuspended(NetworkInfo networkInfo) {
		return networkInfo != null && networkInfo.getState() == State.SUSPENDED;
	} 
 
	public NetworkState getState() {