Code example for BlockingQueue

Methods: contains, put

0
            mTask.start();
        } 
    } 
     
    private void addUrlToDownloadQueue(String url) {
        if (!mUrlList.contains(url)) {
            try { 
                mUrlList.put(url);
            } catch (InterruptedException e) {
                e.printStackTrace();
            } 
        } 
    } 
     
//TODO, ------------ handler for  GetImageTask, to  refresh UI ------------ 
  
    //注意:在一个上下文中,只能有一个Handler,一个Handler对应一个线程 
   private Handler handler = new Handler() {
        @Override 
        public void handleMessage(Message msg) { 
            switch (msg.what) {