public WuziqiPanel(Context context, AttributeSet attrs) { super (context, attrs); setBackgroundColor( 0x44ff0000 ); init(); } private void init() { mPaint .setColor( 0x88000000 ); mPaint .setAntiAlias( true ); mPaint .setDither( true ); mPaint .setStyle(Paint.Style. STROKE ); mWhitePiece = BitmapFactory. decodeResource (getResources(),R.drawable. stone_w2 ); mBlackPiece = BitmapFactory. decodeResource (getResources(),R.drawable. stone_b1 ); }