Android - Add view dynamically
<p>I have a LinearLayout that I am extending and I want to add a ViewFlipper and Views in it dynamically. Can anyone tell me why this is showing a blank screen?</p>

<pre><code>protected void onLayout(boolean changed, int l, int t, int r, int b) 
{
    ViewFlipper vf = new ViewFlipper(context);      
    vf.layout(l, t, r, b);
    this.addView(vf);                       

    TextView tv = new TextView(context);
    tv.setText("FOO");
    tv.setBackgroundColor(Color.WHITE);

    vf.addView(tv, 0, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
</code></pre>

<p>}</p>
