Code example for PriorityQueue

Methods: clear

0
	 
	@Override 
	public Object startModule(IModuleContext ctx) {
		mContentResolver = ((AndroidContext)ctx).getAndroidContext().getContentResolver();		 
		 
		mVideoThumbQueue = new PriorityQueue<VideoThumbRequest>(); 
		mVideoThumbQueue.clear();
		HandlerThread ht = new HandlerThread("video thumb thread", Process.THREAD_PRIORITY_BACKGROUND);
		ht.start();
		mThumbHandler = new Handler(ht.getLooper()) {
		    @Override 
		    public void handleMessage(Message msg) {
		        if (msg.what == IMAGE_THUMB) {
		            synchronized (mVideoThumbQueue) {
		            	VideoThumbRequest req = mVideoThumbQueue.poll();
		            	req.makeThumb();
		            } 
		        } 
		    } 
		};