The Android draw order for bitmaps, drawables and text?
<p>I'm creating a small game in android. Anything that needs to be drawn on screen extends my <code>VisibleObject</code> class, I then have a <code>Manager</code> class that i can add all my visible game objects to and each frame i tell the manager to call the draw function of everything within it.</p>

<p>Here's were objects are initialised and added to the manager:</p>

<pre><code>@Override
    public void surfaceCreated(SurfaceHolder holder) {

        fps = new TextDrawable(Color.BLACK, 14, 100, 40, 40);
        player = new Player();
        map = new Map();
        leftTouch = new TouchCircle(Color.GRAY);

        manager.add("fpsText", fps);
        manager.add("leftTouch", leftTouch);
        manager.add("player", player);
        manager.add("map", map);

        gameloop = new GameLoop(getHolder(), this, fps);            
        gameloop.setRunning(true);
        gameloop.start();

    }
</code></pre>

<p>Now the problem i'm having is with the draw order, if you look at the order the objects are added to the manager for reference..</p>

<ul>
<li>I can tell you for certain that the player is being drawn on top of
the map! These are both drawn by drawing there respective bitmaps with <code>drawBitmap(..)</code>.</li>
<li>However the fpsText and leftTouch are being drawn underneath the map! These are drawn using <code>drawText(..)</code> and <code>drawOval(..)</code> respectively.</li>
</ul>

<p>Even though they implement different <code>Canvas.draw..</code> functions, I would expect them all to be drawn in order as I just pass the canvas object i have to my manager class and then let the manager cycle through each object passing it that canvas to draw with. </p>

<p>Can anyone clear up for me why bitmaps seem to be drawn on top and what the solution should be to get my fps and touch area drawn above the player and map bitmaps? I'd Appreciate it.</p>

<p><strong>EDIT:</strong> I am using <code>private ConcurrentSkipListMap&lt;String, VisibleObject&gt; objectMap;</code> within my manager to store the objects and drawing like so..</p>

<pre><code>public void draw(Canvas c){
        for (Map.Entry&lt;String, VisibleObject&gt; object : objectMap.entrySet()){
            synchronized(object){
                object.getValue().draw(c);
            }
        }
    }
</code></pre>
