title: Draw dash line on a Canvas
body: <p>How can i draw dash line on a canvas. I already tried this:</p>
  
  <pre><code>Paint dashPaint = new Paint();
  dashPaint.setARGB(255, 0, 0, 0);
  dashPaint.setStyle(Paint.Style.STROKE);
  dashPaint.setPathEffect(new DashPathEffect(new float[]{5, 10, 15, 20}, 0));
  canvas.drawLine(0, canvas.getHeight() / 2, canvas.getWidth(), canvas.getHeight() / 2, dashPaint);
  </code></pre>
  
  <p>And it gave me not dash line but a simple one.</p>