Fubo TV Best premium Live TV 2019

how to fix java.lang.OutOfMemoryError at android.graphics.Bitmap.createBitmap

how to fix java.lang.OutOfMemoryError at android.graphics.Bitmap.createBitmap

java.lang.OutOfMemoryError:
  at dalvik.system.VMRuntime.newNonMovableArray (Native Method)
  at android.graphics.Bitmap.nativeCreate (Native Method)
  at android.graphics.Bitmap.createBitmap (Bitmap.java:975)
  at android.graphics.Bitmap.createBitmap (Bitmap.java:946)
  at android.graphics.Bitmap.createBitmap (Bitmap.java:877)
  at android.graphics.Bitmap.createScaledBitmap (Bitmap.java:753)
  at com.google.appinventor.components.runtime.util.MediaUtil$2.run (MediaUtil.java:501)
  at java.lang.Thread.run (Thread.java:818)

This is very common error that you will be getting in your android application, and because of these error application might not work on some devices.

Application gives error message like unfortunately application has stopped. when you try to run application it crashes time to time.

Note: There are several reason behind error; there are different types of solution for it; below some of the solution you can go with; i hop it fix your issue.

1. image(pixel)

you know the size of android device; there are different types of android smartphone and tablets; they have different screen sizes.

You might be having lots of images in your app; do not use image if it is not that necessary; when you use the image decrease the image pixel; as you upload it should not exceed the size of screen, as far as possible decrease the image size to fit smallest screen size or use even smaller if you can.


2. image(dpi)

when you put the image in your android devices; try to decrease the dpi of the image.
currently you might be using certain dpi; and you are getting error crashes for some of the devices; now you can decrease the dpi of your image; re-upload to your android app and test it; these above two guide should fix your issue;  java.lang.OutOfMemoryError at android.graphics.Bitmap.createBitmap