Problem in displaying Bitmaps on canvas
<p>I am have some bitmaps which i want to display serially one after another but my  code displays only last bitmap.Can  anybody tell me why is it happening?
here is the code</p>

<p>class Panel extends SurfaceView implements SurfaceHolder.Callback {</p>

<pre><code>    private boolean _run = false;

    public Panel(Context context) {

        super(context);

        getHolder().addCallback(this);

        _run = true;

    }

    @Override
    public void onDraw(Canvas canvas) {



    }

    @Override
    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {

        Log.i("Read","surfaceChanged is called");
    }

    @Override
    public void surfaceCreated(SurfaceHolder holder) {

        Log.i("Read","surfaceCreated is called");

        while (_run ) {

            display();
        }


    }

    public void display() {

        Canvas c;

        c = null;

        try {

            c = getHolder().lockCanvas(null);

            synchronized (getHolder()) {

                onPreviewFrame();

                invalidate();

                c.drawColor(Color.BLACK);

                c.drawBitmap(bmp, 10, 10, null);

                //panel.surfaceDestroyed(panel.getHolder());
            }

        } finally {

            if (c != null) {

                getHolder().unlockCanvasAndPost(c);
            }

        }


    }

    @Override
    public void surfaceDestroyed(SurfaceHolder holder) {

        Log.i("Read","surfaceDestroyed is called");

        _run = false;


    }

  }
</code></pre>
