Code example for AtomicInteger

Methods: incrementAndGet

0
        lastThread = Thread.currentThread();
        if (eventsReceived != null) {
            eventsReceived.add(event);
        } 
        // Must the the last one because we wait for this 
        eventCount.incrementAndGet();
    } 
 
    @SuppressLint("HandlerLeak") 
    class EventPostHandler extends Handler {
        public EventPostHandler(Looper looper) {
            super(looper);
        } 
 
        @Override 
        public void handleMessage(Message msg) {
            eventBus.post(msg.obj);
        } 
 
        void post(Object event) {
            sendMessage(obtainMessage(0, event));