java.lang.RuntimeException: An error occured while executing doInBackground()

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

For most cases,recommend that you use the Glide library to fetch, decode, and display bitmaps in your app. Glide abstracts out most of the complexity in handling these and other tasks related to working with bitmaps and other images on Android.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • OutOfMemoryError when using Camera Intent
    via Stack Overflow by thhVictor
    ,
  • GitHub comment 1548#156350994
    via GitHub by kriztan
    ,
  • OutOfMemory on big picture (>=16Mo)
    via GitHub by Schoumi
    ,
    • java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:300) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) at java.util.concurrent.FutureTask.setException(FutureTask.java:222) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841) Caused by: java.lang.OutOfMemoryError at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:736) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:712) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:750) at android.provider.MediaStore$Images$Media.getBitmap(MediaStore.java:830) at com.inevitable.org.tab_sample.DisplayContent$SetImageInAsync.doInBackground(DisplayContent.java:236) at com.inevitable.org.tab_sample.DisplayContent$SetImageInAsync.doInBackground(DisplayContent.java:216) at android.os.AsyncTask$2.call(AsyncTask.java:288) at java.util.concurrent.FutureTask.run(FutureTask.java:237)

    Users with the same issue

    balajivaishnav
    balajivaishnav1 times, last one,
    Hiren Amaliyar
    Hiren Amaliyar1 times, last one,
    Unknown visitor2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,