public void run() { while (running) { try { Work w = mQueue.take(); if (w != null && w.contactId == null) { w.contactId = queryContact(w.url); } update(w.contactId, w.url); } catch (InterruptedException e) { Log.d(TAG, "INTERRUPTED!"); } } }