add view to scrollview in android
I have a relative layout inside a scrollview, then i created a new view with this code:

	public class DrawView extends View {
	    Paint paint = new Paint();

	    public DrawView(Context context) {
	        super(context);            
	    }

	    @Override
	    public void onDraw(Canvas canvas) {
	    	paint.setColor(Color.BLACK);
	    	paint.setStrokeWidth(2);
	    	paint.setStyle(Paint.Style.STROKE);
	        canvas.drawRect(5, 5, 140, 140, paint);
	               
	    }
	}

Then i try to use layout.addView(DrawView) to add the new view to the relative layout, so it can be scrollable with the rest of the content, but is doesn't work, nothing shows up..

Am i missing something ?
add view to scrollview in android
===

I have a relative layout inside a scrollview, then i created a new view with this code:

	public class DrawView extends View {
	    Paint paint = new Paint();

	    public DrawView(Context context) {
	        super(context);            
	    }

	    @Override
	    public void onDraw(Canvas canvas) {
	    	paint.setColor(Color.BLACK);
	    	paint.setStrokeWidth(2);
	    	paint.setStyle(Paint.Style.STROKE);
	        canvas.drawRect(5, 5, 140, 140, paint);
	               
	    }
	}

Then i try to use layout.addView(DrawView) to add the new view to the relative layout, so it can be scrollable with the rest of the content, but is doesn't work, nothing shows up..

Am i missing something ?