title: How to pass parameters to a class extending view in android from activity class
body: <p>I have a class which extends Activity. </p>
  
  <p>I also have a layout for that activity which includes a <code>videoview</code> and <code>progressbar</code>.</p>
  
  <p>There is another class which extends View and creates rectangles on top of the progress bar in the activity layout. </p>
  
  <p>I want both the main layout and the rectangles created by view class to be visible in the same screen.</p>
  
  <p>I need to pass parameters to the view class to set the positions of the rectangle. </p>
  
  <p>As far as I know, you cannot set 2 content types from an activity class.</p>
  
  <p>So I ended up calling the view class from my layout like this: </p>
  
  <pre><code>  &lt;com.example.user.CanvasHeat
      android:id="@+id/viewCanvas"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"/&gt;
  </code></pre>
  
  <p>But, this way I cannot pass parameters to the <code>CanvasHeat</code> class. </p>
  
  <p>And if I create the <code>CanvasHeat</code> class from the Activity Class then I cannot set the main layout and the rectangles simultaneously. </p>
  
  <p><strong>How should I display both the layout and the rectangles in the same screen and also pass parameters to the view class?</strong></p>
  
  <p>Thanks</p>