title: Android setText cover the color of rectangle
body: <p>I was creating the chessboard using custom view</p>
  <p>The chessboard was drawn normally using canvas.drawRect()
  and it was drawn using two color, white and green <br />
  <strong>But when I want to draw text using canvas.drawText() <br />
  I found that the text covers the color of rectangle</strong> <br />
  <a href="https://i.stack.imgur.com/sW4mv.jpg" rel="nofollow noreferrer">original chessboard</a><br />
  <a href="https://i.stack.imgur.com/sRYNv.jpg" rel="nofollow noreferrer">after walking somewhere color is green</a></p>
  <p>In the onDraw function I go through nested for loop for 2 dimensions like below <br />
  Assume the chessboard is 8x8
  cellSize is for rectangle size</p>
  <pre class="lang-java prettyprint-override"><code>for(int i = 0; i &lt; rows; ++i) {
      for(int j = 0; j &lt; cols; ++j) {
          if (visited[i][j] &gt; 0) {
              // if visited just draw the rectangle red
              mPaint.setColor(Color.RED);
  
              canvas.drawRect(j * cellSize, i * cellSize,
                             (j + 1) * cellSize, (i + 1) * cellSize, mPaint);
              continue;
          }
  
  
          if (i == mCurPosition.x &amp;&amp; j == mCurPosition.y) {
              // centerY is calculated for alignment
              canvas.drawText(&quot;@&quot;, j * cellSize + cellSize / 2, centerY, mPaint);
              continue;
          }
  
          mPaint.setStyle(Paint.Style.FILL);
          if ((i &amp; 1) == 0 &amp;&amp; (j &amp; 1) == 0 || (i &amp; 1) == 1 &amp;&amp; (j &amp; 1) == 1)
              mPaint.setColor(Color.WHITE);
          else
              mPaint.setColor(Color.rgb(118, 150, 86));
  
          canvas.drawRect(j * cellSize, i * cellSize, (j + 1) * cellSize, (i + 1) * cellSize, mPaint);
  
      }
  }
  </code></pre>
  <p>I tried not to use continue statement in second if condition <br />
  but the '@' seems to be covered by the rectangle color <br />
  Is there way to fix this problem? <br />
  Thanks</p>