Code example for SupplicantState

Methods: equals, name

0
	@Override 
	public void onReceive(Context context, Intent intent) {
		SupplicantState state = intent
				.getParcelableExtra(WifiManager.EXTRA_NEW_STATE);
		if (state != null) {
			Log.d(this.getClass().getSimpleName(), state.name());
			if (state.equals(SupplicantState.COMPLETED)) {
				listener.onSuccessfulConection();
				return; 
			} 
			if (state.equals(SupplicantState.DISCONNECTED)) {
				listener.onFailedConnection();
				return; /* Failed */ 
			} 
		} 
 
	} 
 
	public interface onConnectionListener { 
		public void onFailedConnection();