title: Moving Android View and preventing onDraw to be called over and over again
body: <p>I'm extending the <code>View</code>-class, to what I call <code>MyView</code>. (I've added some properties which basically says what is drawn on the object, and handling this)</p>
  
  <p>I'm moving an object of this class once every few milliseconds, this works great. I'm using <code>this.layout(left, top, right, bottom);</code> to move the MyView. But it seems like every time the view is moved, it is redrawn (onDraw is called). Is this necessary? The contents of <code>MyView</code> does not change when it is moved. In fact, the contents will never change - it's created in one way, moves around, and later gets destroyed.</p>
  
  <p>I'm using <code>onDraw</code> because every time it is created I want it to draw some text or some numbers on it. I used to extend <code>ImageView</code> and use <code>setImageResource</code> but I realized I want more than just different images on this and creating images for all kinds of text and number content this object can have did not feel right.</p>
  
  <p>It is also important that my object can receive onTouch events, which works fine today.</p>
  
  <p>My onDraw-method contains at the moment: (this will change, when I get it to not repaint all the time)</p>
  
  <pre><code>@Override
  public void onDraw(Canvas canvas) {
      Paint p = new Paint();
      p.setARGB(255, 0, 255, 255);
      canvas.drawRect(0, 0, 32, 32, p);
  }
  </code></pre>
  
  <p>So the question is: Can I have an object that is <strong>drawn dynamically when created</strong>, have the possibility to <strong>receive touch events</strong> (I could solve this another way so it's not very important), and <strong>move it around without it being repainted (most important)?</strong> </p>
  
  <p>The reason is: I'm going to have several objects (could be 100+) of this class and I believe that the application will be slowed down by repainting the objects all the time.</p>
  
  <p>Edit:
  If it's not possible with a View, is there <strong>any alternative that I can use?</strong></p>