Code example for ExecutorService

Methods: execute

0
        int id = (int) ContentUris.parseId(intent.getData());
        Alarm alarm = mAlarms.get(id);
        if (alarm == null) {
            return; 
        } 
        sExecutor.execute(new Worker(alarm));
    } 
 
    private class Worker implements Runnable {
        private final Alarm mAlarm;
 
        public Worker(Alarm alarm) {
            mAlarm = alarm;
        } 
 
        public void run() { 
            mWakeLock.acquire();
            try { 
                Callback callback = mAlarm.mCallback;
                long nextSchedule = callback.sendHeartbeat();
                if (nextSchedule <= 0) {