Dynamic View creation, when rendering it to a Canvas fails 
<p>Hi I am trying to draw a complex view, defined by an xml layout to a Bitmap (which is afterwards drawn to a canvas). That view is then updated regularly, when something changed in the data model. 
Changing statically defined TextView works perfect, but adding new Views to a linearLayout is somehow not working. Where is my mistake? </p>

<p>This is how I am adding new Views:</p>

<pre><code>           linearLayoutContainer.removeAllViewsInLayout();

            for (int i = 0 ; i &lt; 5; i ++) {

                TextView child = new TextView(getContext());
                child.setText("example" + i);
                child.setVisibility(View.VISIBLE);
                linearLayoutContainer.addView(child, i , new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT));
                i++;
            }
</code></pre>

<p>this is how I am crating the bitmap:</p>

<pre><code>    sideBarView.refresh();
    sideBarView.invalidate();
    sideBarBitmap = sideBarView.getDrawingCache();
</code></pre>

<p>which works perfectly for updating the already in xml defined TextViews, but the new added views are not visible.</p>

<p>My xml layout looks like that:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
</code></pre>

<p></p>

<pre><code>&lt;TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="some"
    android:textSize="20dp" /&gt;

&lt;LinearLayout
    android:id="@+id/linearLayoutContainer"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="0.33"
    android:gravity="center_horizontal" &gt;

&lt;!-- THE CONTAINER --&gt;

&lt;/LinearLayout&gt;

&lt;LinearLayout
    android:id="@+id/linearLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="center"
    android:layout_weight="0.66"
    android:gravity="center"
    android:orientation="horizontal" &gt;

&lt;TextView
    android:id="@+id/TextView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="2dp"
    android:text="20%"
    android:textSize="30dp" /&gt;

&lt;TextView
    android:id="@+id/TextView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="3dp"
    android:text="35%"
    android:textSize="30dp" /&gt;

&lt;/LinearLayout&gt;
</code></pre>
