Code example for Handler

Methods: sendEmptyMessage

0
 
    public static void wakeupMainDispatcher() { 
        courier.sendEmptyMessage(0);
    } 
 
 
    public static Bitmap createBitmap(int width, int height) {
        return Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
    } 
 
    public static void pushBitmap(final Bitmap b) {
 
        currentActivity.runOnUiThread(new Runnable() {
                public void run() { 
 
                    SurfaceHolder sh = sv.getHolder();
 
                    sh.setFormat(PixelFormat.RGBA_8888);
 
                    Canvas c = sh.lockCanvas();
                    c.drawBitmap(b, null, sh.getSurfaceFrame(), null);