Combine canvas and layout?
<p>Presumably it must be quite common to desire a screen in which 
there are graphical elements (for which you may like to use a canvas) and widgets/buttons on the same screen. But everything I've looked at so far gives examples of either screens full of widgets <em>OR</em> whole screen canvases. Can someone point me to some example code for using both at the same time.</p>

<p>...or is this not the done thing?</p>

<p><strong>EDIT:</strong> Following on from Steve's suggestion my code now looks like this:</p>

<pre><code>public class CanLay extends Activity
{
    Bitmap bm;
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);

        setContentView(R.layout.canlay);

        InputStream is = getResources().openRawResource(R.drawable.ella);
        bm = BitmapFactory.decodeStream(is);

        SurfaceView sv;
        SurfaceHolder sh;
        Canvas can = null;

        sv = (SurfaceView)findViewById(R.id.surview);
        sh = sv.getHolder();

        try
        {
            can = sh.lockCanvas(null);

            synchronized(sh)
            {
                can.drawBitmap(bm, 0, 0, null);         
            }
        }
        finally
        {
            if (can != null)
            {
                sh.unlockCanvasAndPost(can);
            }
        }
    }
}
</code></pre>

<p>The only problem now is that sh.lockCanvas(null); always returns null.</p>
