Overloading onDraw() method in my view
<p>I am create a custom view which draw text in the middle (vertical/horizontal) aligned in the view.</p>

<p>In my view constructor, I create a Paint and TextBound object, like this:</p>

<pre><code>    final TypedArray ta = context.obtainStyledAttributes(attrs,
            R.styleable.MYSTYLE);

    mText= ta.getText(R.styleable.MYSTYLE_text);
    ta.recycle();
    if (mText != null) {
        mPaint = new Paint();
        mPaint.setColor(Color.BLACK);
        mPaint.setStyle(Paint.Style.FILL);
        mPaint.setTextSize(35);
        mTextBound = new Rect();
        mPaint.getTextBounds(mText.toString(), 0, mText.length(), mTextBound);
        Log.d("M", "mPaint w= " + mTextBound.width() + "  h= " + mTextBound.height() +
               " t= " + mTextBound.top + "  b= " + mTextBound.bottom +
               " l= " + mTextBound.left + "  r= " + mTextBound.right);
    }
</code></pre>

<p>And then in my onDraw() method, I call this to paint the text:</p>

<pre><code>protected void onDraw(Canvas canvas) {
    if (mText != null) {
        Log.d("M", "onDraw () " + mText);
        Log.d("M", "mPaint w= " + mTextBound.width() + "  h= " + mTextBound.height() +
                " t= " + mTextBound.top + "  b= " + mTextBound.bottom +
                " l= " + mTextBound.left + "  r= " + mTextBound.right);
        canvas.drawText(mText.toString(), mTextBound.exactCenterX(), mTextBound.exactCenterY(), mPaint);
    }

}
</code></pre>

<p>I see my Constructor and onDraw being called. But I don't see the text on the screen.</p>

<p>Any idea?</p>

<p>Thank you.</p>
