Android‎ > ‎

draw() & OnDraw()

posted Feb 15, 2013, 5:03 AM by Akash Khaitan   [ updated Mar 9, 2013, 7:38 AM ]
draw() method does a few things like drawing the background and handling fade, then calls your onDraw() function.
All your real drawing calls should be in your onDraw() function.

Basically draw() method is used to send canvas to the onDraw() method

bitmap = Bitmap.createBitmap(width, height,Bitmap.Config.ARGB_8888);
draw(new canvas(bitmap));

These lines of code creates a canvas with a bitmap in it and passes it to onDraw() and further operations can be performed there