title: Android: Caching images for imageView
body: <p>I'm writing an android app which calls codeline B many times.</p>
  
  <p>Therefore I would like to cache the image 'image123' somewhere for performance reasons / making the app faster and only want to load it once and then just display it from the cache somehow.</p>
  
  <p>Is there a way to achieve this without loading it again and again? Does anybody know ?</p>
  
  <p>Is it important to call invalidate() (codeline C) just to be sure the image is always displayed immediately ? How can I find out when the image is displayed in the imageView exactly ? </p>
  
  <p>Thanks for your help in advance.   </p>
  
  <pre><code>// codeline A
  ImageView imageView = (ImageView) this.findViewById(R.id.imageView);
  // codeline B
  imageView.setImageResource(R.mipmap.image123);
  // codeline C
  imageView.invalidate();
  </code></pre>