title: How to draw Custom View Extending Relative Layout to a canvas
body: <p>I have my main activity which creates an instance of SurfaceView. In the SurfaceView I am creating several simple objects from bitmaps. I pass a canvas element to them (objectX.draw(canvas)...etc) from a render method in the SurfaceView. all of this is working as i would like, however I would like to do the same with a custom RelativeLayout. </p>
  
  <p>For example i would like to create a custom class extending RelativeLayout and fill it with various objects such as ImageView etc and then from the SurfaceView call a method which draws this to the canvas.</p>
  
  <p>I have been looking for tutorials to help me understand how to do this but cannot find anything. I understand that I have to draw a bitmap of the RelativeLayout and then in turn draw that to my canvas which the surface view is passing in to it. I think a lot of my issues may be coming from the fact that i am not trying to ever add the Custom RelativeLayout to the screen, instead I would like to create it by inflating an xml layout and simply drawing to a passed in canvas.</p>