Code example for Queue

Methods: sizepeek

		Log.d(this.getClass().getName() + "sendNextMessage", "Sending next message in queue");
		 * Perform check that the top message should be sent (time has elapsed) 
		if (messageQueue != null && messageQueue.size() != 0)
			SMSMessage message = messageQueue.peek();
			if (message != null)
				Calendar msgTime = messageQueue.peek().getDateTime();
				if (msgTime.before(Calendar.getInstance()))
					removeMessage(message);//Remove from the queue and underlying db
					Log.d(this.getClass().getName() + "sendNextMessage", "Message sent.");
					//If message was recurring, insert back into queue with an adjusted date. 
					if (message.getRecurOptions() != null && message.getRecurOptions().isRecurring())
Experience pair programming with AI  Get Codota for Java