Code example for Handler

Methods: getLooper

0
    } 
 
    @Override 
    protected void tearDown() throws Exception { 
        if (mHandler != null) {
            mHandler.getLooper().quit();
            mHandler = null;
        } 
        if (mLooperThread != null) {
            mLooperThread.join(WAIT_TIMEOUT);
            if (mLooperThread.isAlive()) {
                fail("Failed to stop the looper.");
            } 
            mLooperThread = null;
        } 
        mOutput.write("\n\n");
        mOutput.close();
        super.tearDown(); 
    } 
 
    private void runOnLooper(final Runnable command) throws InterruptedException {