Problem with SurfaceView and its holder
<p>Hi All
I tried to use SurfaceView, but the view appeared black and nothing painted
<strong>Here My code</strong></p>

<pre><code>package com.samples;

import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import android.graphics.BlurMaskFilter;
import android.graphics.BlurMaskFilter.Blur;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PorterDuff;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
import android.graphics.RectF;
import android.graphics.Region;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceHolder.Callback;
import android.view.SurfaceView;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

public class Galary extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(new GalaryView(this));

    }

    private static class GalaryView extends SurfaceView implements Callback {

        private SurfaceHolder surfaceHolder;

        public GalaryView(Context context) {
            super(context);
            surfaceHolder = getHolder();
            surfaceHolder.addCallback(this);
        }

        @Override
        public void surfaceChanged(SurfaceHolder holder, int format, int width,
                int height) {
            // TODO Auto-generated method stub

        }

        @Override
        public void surfaceCreated(SurfaceHolder holder) {
            // TODO Auto-generated method stub
            Effects effects= new Effects(surfaceHolder, this);
            effects.start();
        }

        @Override
        public void surfaceDestroyed(SurfaceHolder holder) {
            // TODO Auto-generated method stub

        }
    }
}
</code></pre>

<p><strong>and the second file</strong></p>

<pre><code>package com.samples;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.graphics.Region;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class Effects extends Thread {
    private SurfaceView surfaceView;
    private SurfaceHolder surfaceHolder;
    private Bitmap bitmap1;
    private Path mPath;
    private Bitmap bitmap2;
    private Paint paint;

    public Effects(SurfaceHolder surfaceHolder, SurfaceView surfaceView) {
        this.surfaceView = surfaceView;
        this.surfaceHolder = surfaceHolder;
        this.mPath = new Path();
        bitmap1 = BitmapFactory.decodeResource(surfaceView.getContext()
                .getResources(), R.drawable.qina1);
        bitmap2 = BitmapFactory.decodeResource(surfaceView.getContext()
                .getResources(), R.drawable.qina2);

        paint= new Paint();
    }

    @Override
    public void run() {
        Canvas canvas = surfaceHolder.lockCanvas();
        canvas.drawColor(Color.WHITE);
        for (int i = 1; i &lt; 100; i++) {
            canvas.drawBitmap(bitmap1, 0, 0, null);
            canvas.save();
            canvas.translate(0, 0);
            mPath.reset();
            canvas.clipPath(mPath);
            int ovalWidth = (int) (surfaceView.getWidth() * (i / 100.0));
            int ovalHeight = (int) (surfaceView.getHeight() * (i / 100.0));
            int ovalX = (surfaceView.getWidth() - ovalWidth) / 2;
            int ovalY = (surfaceView.getHeight() - ovalHeight) / 2;
            mPath.addOval(new RectF(ovalX, ovalY, ovalWidth + ovalX, ovalHeight
                    + ovalY), Path.Direction.CCW);
            canvas.clipPath(mPath, Region.Op.REPLACE);
            canvas.drawBitmap(bitmap2, 0, 0, paint);
            canvas.restore();
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }

}
</code></pre>

<p>Please could you tell me what is the problem?
Thanks a lot</p>
