title: Best practices to load several bitmaps multiple times
body: <p>I am creating an Android board game similar to, for example, <a href="https://play.google.com/store/apps/details?id=sp.app.bubblePop" rel="nofollow">Bubble Pop</a> where I need to use several bitmaps multiple times. </p>
  
  <p>I have a list of Stones (10x10), where each Stone is an object which holds its bitmap and some other values. Lot of bitmaps (stone colors) are same. </p>
  
  <p>Right now i am using something like this for every Stone in the list:</p>
  
  <pre><code>public class Stone extends Point{
  
    private Bitmap mImg;
  
    public Stone (int x, int y, Resources res, Stones mStone) {
      ...
      mImg = BitmapFactory.decodeResource(mRes, mStone.getId());
    }
  
    protected void changeColor(Stones newD){
        mStone = newD;
        mImg = BitmapFactory.decodeResource(mRes, mStone.getId());
      }
    }
  </code></pre>
  
  <p>I found several similar questions, but it is all about big bitmaps. Also i found some <a href="http://developer.android.com/training/displaying-bitmaps/cache-bitmap.html" rel="nofollow">Android documentation about caching images</a>, but i am not sure if it solves my problem and how to share this cache between all my stones.</p>
  
  <p>What is the best practice, to achive good performance and avoid OutofMemoryError?</p>