Code example for Stack

0
    /** 
     * Helper class to send messages synchronously 
     */ 
    private static class SyncMessenger { 
        /** A stack of SyncMessengers */ 
        private static Stack<SyncMessenger> sStack = new Stack<SyncMessenger>();
        /** A number of SyncMessengers created */ 
        private static int sCount = 0;
        /** The handler thread */ 
        private HandlerThread mHandlerThread;
        /** The handler that will receive the result */ 
        private SyncHandler mHandler;
        /** The messenger used to send the message */ 
        private Messenger mMessenger;
 
        /** private constructor */ 
        private SyncMessenger() { 
        } 
 
        /** Synchronous Handler class */ 
        private class SyncHandler extends Handler {