redraw the Line while stretch it from one end : android
<p>I want to add a line on my layout and when i touch one end of line it should move to any position and old one should be deleted , and able to small and big the size of line when stretch it from one end , other end should be in its place , so how would it be possible in android as well in java , i am unable to do it from morning..
any help should be highly appreciated..
please ignore below code:</p>

<pre><code>   List&lt;Point&gt; points = new ArrayList&lt;Point&gt;();  
Paint paint = new Paint();   
public DrawView(Context context) {  
    super(context);        setFocusable(true);  
    setFocusableInTouchMode(true);     
    this.setOnTouchListener(this);   
    paint.setColor(Color.BLACK);    
    paint.setAntiAlias(true);   
    }  
@Override  
    public void onDraw(Canvas canvas) {     
    for (Point point : points) {     
        canvas.drawCircle(point.x, point.y, 5, paint);   
        // Log.d(TAG, "Painting: "+point);    
        }  
    }    public boolean onTouch(View view, MotionEvent event) { 
        // if(event.getAction() != MotionEvent.ACTION_DOWN)    
        // return super.onTouchEvent(event);      
        Point point = new Point(); 
        point.x = event.getX();    
        point.y = event.getY();   
        points.add(point);     
        invalidate();     
        Log.d(TAG, "point: " + point);  
        return true;  
        }
    }
  class Point { 
            float x, y;    @Override  
            public String toString() { 
                return x + ", " + y;  
                }
            }
</code></pre>
