Code example for Queue

Methods: addAll

0
this.ctx = ctx;
 
		Comparator<SMSMessage> comparator = new SMSMessageDeliveryTimeComparator();
		messageQueue = new PriorityBlockingQueue<SMSMessage>(11, comparator);
		messageQueue.addAll(messages);
	} 
 
	public static SMSDeliveryService getInstance(Context ctx)
	{ 
		if (_instance == null)
		{ 
			SMSMessageDBAdapter adapter = new SMSMessageDBAdapter(ctx);
			adapter.open();
 
			Collection<SMSMessage> c = adapter.getAllMessages();
 
			_instance = new SMSDeliveryService(ctx, c);
 
			// Start the background Delivery service 
			_instance.startBGDeliveryService();