java.lang.OutOfMemoryError: bitmap size exceeds VM budget
<p>I'm using a <code>BitmapFactory</code> to decode a JPG from file and then setting the <code>imageBitmap</code> of an <code>ImageView</code> with that. Sometimes, the app crashes with "<code>java.lang.OutOfMemoryError: bitmap size exceeds VM budget</code>"</p>

<p>I've tried using:  </p>

<pre><code>BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 2;
Bitmap bm = BitmapFactory.decodeFile(filepath, options);
</code></pre>

<p>it seemed to be working for  a while, but not anymore. What can I do?</p>
