Dear all,

I coded a simple customize TextView in my project but there is an error 
message (Graphic is disposed) show when loading the preview. how to solve?

<--       my code is below -->

private void init() {
// TODO Auto-generated method stub
paintTableFrame = new Paint(Paint.ANTI_ALIAS_FLAG);
paintTableFrame.setColor(myResources.getColor(TABLE_FRAME_COLOR));
paintTableFrame.setStyle(Paint.Style.FILL_AND_STROKE);
paintTable = new Paint(Paint.ANTI_ALIAS_FLAG);
paintTable.setColor(myResources.getColor(TABLE_COLOR));
paintTable.setStyle(Paint.Style.FILL_AND_STROKE);
 }

@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
 canvas.drawRect(0, 0, getMeasuredWidth(), getMeasuredHeight(), 
paintTableFrame);
 canvas.drawRect(MARGIN, MARGIN, getMeasuredWidth()-MARGIN, 
getMeasuredHeight()-MARGIN, paintTable);
 canvas.save();
super.onDraw(canvas);
 canvas.restore();
}


Thanks
HK Tsang

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to