Code example for LinkedList

Methods: getFirst, size

0
        synchronized (mQueue) {
            mQueue.clear();
        } 
    } 
 
    void scheduleNextLocked() { 
        if (mQueue.size() > 0) {
            Runnable peek = mQueue.getFirst();
            if (peek instanceof IdleRunnable) {
                mMessageQueue.addIdleHandler(mHandler);
            } else { 
                mHandler.sendEmptyMessage(1);
            } 
        } 
    } 
}