Android Custom Surface View graph is going behind the grid
<p>In the code below when I remove canvas.drawColor(0, PorterDuff.Mode.CLEAR) the graph starts flickering up and down on the grid. Does anyone know what might cause this?</p>

<pre><code> public void drawScan()
 {    
      DrawTask = new TimerTask() 
        {  
         public void run() 
        {
            Canvas canvas;
                    if(_run)
                      {  

                      canvas =  null; //new Canvas(bitmap);
                          try 
                           {
                                canvas = _surfaceHolder.lockCanvas(null); 
                                canvas.drawColor(0, PorterDuff.Mode.CLEAR);
                                PlotRealTimeGraph(canvas);   
                            }
                                catch(Exception e1)
                                {
                                    e1.printStackTrace();
                                }
                                finally 
                                {                                       
                                    if (canvas != null) 
                                      {
                                                _surfaceHolder.unlockCanvasAndPost(canvas);
                                      }
                                }                           
                   }            
        }};         
  timer.scheduleAtFixedRate(DrawTask,1000,40); 


}   
</code></pre>
