Code example for Looper

Methods: quit

0
     
    /* 
     * Terminates the message looper thread. 
     */ 
    private static void terminateMessageLooper() { 
        mLooper.quit();
        mMediaPlayer.release();
    } 
     
    static MediaPlayer.OnPreparedListener mPreparedListener = new MediaPlayer.OnPreparedListener() {
        public void onPrepared(MediaPlayer mp) { 
            synchronized (prepareDone) { 
                if(mPrepareReset){ 
                    Log.v(TAG, "call Reset"); 
                    mMediaPlayer.reset(); 
                } 
                Log.v(TAG, "notify the prepare callback"); 
                prepareDone.notify(); 
                onPrepareSuccess = true; 
            }