how to draw path into the view in android
<p>Hi i need to draw a path simple lines to the canvas it should write out red rectangle with white lines.but it do not draw out nothing what m i missing.
my code:</p>

<pre><code>Canvas canvas = new Canvas();


       Paint paint = new Paint();

       paint.setStyle(Paint.Style.FILL);
       paint.setColor(Color.RED);
       canvas.drawPaint(paint);
       Path path = new Path();
       //canvas.drawColor(Color.CYAN);

       for (int i = 5; i &lt; 50; i++) {

           path.moveTo(4, i-1);
           path.lineTo(4, i);

       }
       path.close();

       paint.setStrokeWidth(3);
       paint.setPathEffect(null);
       paint.setColor(Color.WHITE);
       paint.setStyle(Paint.Style.STROKE);

       canvas.drawPath(path, paint);

        for (int i = 0; i &lt; 3; i++) {
            View iview =    inflater.inflate(R.layout.linear_layout, null);
            if(i == 0){
                iview.findViewById(R.id.imageView1).setBackgroundResource(R.drawable.distspeed);
            }
            if(i == 1){
                iview.findViewById(R.id.imageView1).setBackgroundResource(R.drawable.hxmdist);
            }
            if(i == 2){
                iview.findViewById(R.id.imageView1).setBackgroundResource(R.drawable.hxmspeeed);
            }

            iview.draw(canvas);

            realViewSwitcher.addView(iview);
        }
</code></pre>
