onDraw() will only be called when the view is in the content view of
the Activity and visible!

On 5 mrt, 20:25, mcmc <[email protected]> wrote:
> I cannot get the onDraw function to be called. Here is the what my
> basic code looks like. What triggers the onDraw to be called?
>
>         private class DemoView extends View{
>
>                 public DemoView(Context context){
>                         super(context);
>                 }
>
>                 @Override protected void onDraw(Canvas canvas) {
>                         super.onDraw(canvas);
>                         canvas.drawColor(Color.WHITE);
>                 }
>
>                 public void drawTest() {
>
>                         // do something
>
>                         // i want onDraw to be called here
>
>                         // do something
>
>                 }
>         }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to