title: Drawing multiple views on android
body: <p>I have found similar questions but none of those give a proper answer to my question.</p>
  
  <p>I have a class that is a view.</p>
  
  <pre><code>public class Actor extends View {
  private ShapeDrawable drawable;
  
  int x = 0;
  int y = 0;
  int width = 100;
  int height = 40;
  
  public Actor(Context context) {
      super(context);
  
      drawable = new ShapeDrawable(new OvalShape());
      drawable.getPaint().setColor(0xff74AC23);
      drawable.setBounds(x, y, x + width, y + height);
  }
  
  @Override
  public void onDraw(Canvas canvas){
      super.onDraw(canvas);
      drawable.draw(canvas);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>What I want to do now is draw multiple instances of this view on the android screen. I can draw one by doing this in an activity:</p>
  
  <pre><code> @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      Dimension actor1 = new Actor(this);
      setContentView(actor1);
  }
  </code></pre>
  
  <p>My goal is to draw multiple instances of it, of course with other x and y parameters so they don't overlap. I don't want to convert the view to a bitmap first to get it in a canvas.</p>