Code example for HandlerThread

Methods: quit

0
 
    @Override 
    public void onDestroy() { 
        super.onDestroy(); 
        if (mThread != null) {
            mThread.quit();
        } 
    } 
 
    class DrawableEngine extends Engine {
        private final Object mLock = new Object();
        private WallpaperObserver mReceiver;
        Drawable mBackground;
        float mXOffset;
        float mYOffset;
 
        class WallpaperObserver extends BroadcastReceiver {
            public void onReceive(Context context, Intent intent) {
                updateWallpaper(); 
                drawFrame(); 
                // Assume we are the only one using the wallpaper in this