title: Android - redraw canvas
body: <p>I have <strong>3</strong> ImageViews. <strong>1st</strong> and <strong>2nd</strong> <strong>connected</strong> with red <strong>line</strong>. Also I have simple button. Here is a picture:</p>
  
  <p><img src="https://i.stack.imgur.com/zAn04.jpg" alt="enter image description here"></p>
  
  <p>I want to <strong>connect</strong> <strong>2nd &amp; 3rd</strong> ImageViews with <strong>new Path line</strong> and <strong>change the first line color</strong> (for example to Green) when i clicking my button. Here is parts of my code:</p>
  
  <pre><code>public class SkillPath extends View {
  Paint paint;
  Path path;
  
  ... constructors
  
  
  @Override
  protected void onDraw(Canvas canvas) {
      addPath (canvas);       
  }
  
  //Here is my RED line
  void addPath (Canvas canvas){
      paint.setAntiAlias(true);
      paint.setColor(Color.RED);
      paint.setStrokeWidth(3);
  
      path.moveTo(110, 110);
      path.lineTo(210, 110);
  
      canvas.drawPath(path, paint);
      Log.d ("Page 2","onDraw");
  }
  </code></pre>
  
  <p>I can get all coordinates of all Views, but <strong>how can I redraw existing canvas</strong>? I suspect, I need to use <strong>invalidate()</strong>, but I do not know enough to do this. Need help.</p>