Code example for Looper

Methods: getThreadquit

     * Terminates the message looper thread. 
    private void terminateMessageLooper() throws Exception { 
        // Looper.quit() is asynchronous. The looper may still has some 
        // preview callbacks in the queue after quit is called. The preview 
        // callback still uses the camera object (setHasPreviewCallback). 
        // After camera is released, RuntimeException will be thrown from 
        // the method. So we need to join the looper thread here. 
    //Implement the previewCallback 
    private final class RawPreviewCallback implements PreviewCallback { 
        public void onPreviewFrame(byte [] rawData, Camera camera) {         
            Log.v(TAG, "Preview callback start");            
            int rawDataLength = 0;
            if (rawData != null) {