views:

36

answers:

1

Hi all,

I'm subclassing Android's view class, but whenever I make an instance of the view from another class, the constructor never gets called (or so it seems). I've implemented both public myclass (Context context) and public myclass (Context context, AttributeSet, attrs)

I can't figure out what I'm doing wrong. Do I need to override onDraw and onMeasure?

Thanks for help in advance!

A: 

I'm unsure what your code is so I'll just show you a Draw that worked for me

    class DrawOnTop extends View { 
    public DrawOnTop(Context context) { 
            super(context); 
            // TODO Auto-generated constructor stub 
    } 
    @Override 
    public void onDraw(Canvas canvas) { 
            // TODO this is where stuff is drawn.

    } 

}

Ulkmun