Code example for ServiceState

Methods: getState

0
		} 
 
		@Override 
		public void onServiceStateChanged(ServiceState serviceState) { 
			String serviceStateString = "UNKNOWN"; 
			switch (serviceState.getState()) { 
			case ServiceState.STATE_IN_SERVICE: 
				serviceStateString = "IN SERVICE"; 
				break; 
			case ServiceState.STATE_EMERGENCY_ONLY: 
				serviceStateString = "EMERGENCY ONLY"; 
				break; 
			case ServiceState.STATE_OUT_OF_SERVICE: 
				serviceStateString = "OUT OF SERVICE"; 
				break; 
			case ServiceState.STATE_POWER_OFF: 
				serviceStateString = "POWER OFF"; 
				break; 
			default: 
 
				serviceStateString = "UNKNOWN";