then no need to create CustomView. try this. it may help you...
public void onClick(View view) {
switch (view.getId()) {
case R.id.wallpaper:
Bitmap bitmap = getWallPaperBitmap();
.......
wallPaperManager.setBitmap(bitmap);
break;
default:
break;
}
}
public static Bitmap getWallPaperBitmap() {
Bitmap bitmap = Bitmap.createBitmap(50, 50, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
canvas.drawARGB(0, 0, 0, 0);
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setColor(Color.RED);
// this style will fill the circle
paint.setStyle(Paint.Style.FILL);
// this style will draw Circle path.
paint.setStyle(Paint.Style.STROKE);
canvas.drawCircle(bitmap.getWidth()/2, bitmap.getHeight()/2, 40, paint);
return bitmap;
}