Previous screen bleeds through Views before surfaceCreated called
<p>This is a toy example. If you compile this and test on an actual device (not the emulator) you will see that the first time the SurfaceView is attached, the whole screen content changes appropriately. However, upon pressing back and then pressing the button again, you will see that a tiny line at the top remains blue from the previous screen and only disappears after the Surface is created. This is happening in my app in all my views (sans SurfaceView) and is distracting to the point of annoyance. Has anyone seen this issue before? Is there a workaround? I am running this on HTC EVO on Android 2.1</p>

<pre><code>package com.example.surfaceviewtest;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.SurfaceView;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;

public class MainActivity extends Activity {

    private RelativeLayout home;
    private RelativeLayout newView;
    private int view;

    /* (non-Javadoc)
     * @see android.app.Activity#onCreate(android.os.Bundle)
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        home = new RelativeLayout(this);
        home.setBackgroundColor(Color.BLUE);
        Button changeCV = new Button(this);
        changeCV.setText("Change Content View");
        changeCV.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                setContentView(newView, new RelativeLayout.LayoutParams(
                    LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
                view = 2;
            }
        });
        RelativeLayout.LayoutParams buttonParams = new RelativeLayout.LayoutParams(
            LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        buttonParams.addRule(RelativeLayout.CENTER_IN_PARENT);
        home.addView(changeCV, buttonParams);

        newView = new RelativeLayout(this);
        RelativeLayout.LayoutParams surfaceParams = new RelativeLayout.LayoutParams(
            LayoutParams.FILL_PARENT, 200);
    surfaceParams.addRule(RelativeLayout.CENTER_IN_PARENT);
        SurfaceView surfView = new SurfaceView(this);
        newView.addView(surfView, surfaceParams);
        RelativeLayout.LayoutParams tvParams = new RelativeLayout.LayoutParams(
            LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
        tvParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
        TextView tv = new TextView(this);
        newView.addView(tv, tvParams);

        setContentView(home, new RelativeLayout.LayoutParams(
            LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
        view = 1;
    }

     /* (non-Javadoc)
     * @see android.app.Activity#onBackPressed()
     */
    @Override
    public void onBackPressed() {
        if (view == 2) {
            setContentView(home, new RelativeLayout.LayoutParams(
                LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
            view = 1;
        }
        else {
            finish();
        }
    }   
}
</code></pre>
