I have a problem with my app.
When i jump between 2 screens several times (depending on device memory), then the app crashes with an Out of memory error.
in logcat i get this:
01-09 15:46:11.029 22623 22944 I art : Alloc concurrent mark sweep GC freed 1(32B) AllocSpace objects, 0(0B) LOS objects, 0% free, 79MB/80MB, paused 821us total 62.200ms
01-09 15:46:11.029 22623 22944 W art : Throwing OutOfMemoryError “Failed to allocate a 4000012 byte allocation with 126416 free bytes and 123KB until OOM”
01-09 15:46:11.029 22623 22944 D skia : — decoder->decode returned false
01-09 15:46:11.073 22623 22633 I art : Background sticky concurrent mark sweep GC freed 65(20KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 79MB/80MB, paused 7.716ms total 42.854ms
01-09 15:46:11.079 22623 22944 E AndroidRuntime: FATAL EXCEPTION: Thread-1350
01-09 15:46:11.079 22623 22944 E AndroidRuntime: Process: io.kodular.Launcher_Universal_radio_tv, PID: 22623
01-09 15:46:11.079 22623 22944 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 4000012 byte allocation with 126416 free bytes and 123KB until OOM
01-09 15:46:11.079 22623 22944 E AndroidRuntime: at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
01-09 15:46:11.079 22623 22944 E AndroidRuntime: at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
01-09 15:46:11.079 22623 22944 E AndroidRuntime: at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:635)
01-09 15:46:11.079 22623 22944 E AndroidRuntime: at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:611)
01-09 15:46:11.079 22623 22944 E AndroidRuntime: at com.google.appinventor.components.runtime.util.MediaUtil.hxYOFxFjLpN1maJuWNxUV40nExCGxsxkDPOTgtzMu4zlZCQb3bPlKsXo1SYJg6ME(SourceFile:509)
01-09 15:46:11.079 22623 22944 E AndroidRuntime: at com.google.appinventor.components.runtime.util.MediaUtil.B8WBXPBCF2jGfUDZZU2zV5EYdqbUBu0lAZ0THCEqYyuE8VACR9dY7rDnwBIqh64T(SourceFile:42)
01-09 15:46:11.079 22623 22944 E AndroidRuntime: at com.google.appinventor.components.runtime.util.MediaUtil$2.run(SourceFile:456)
01-09 15:46:11.079 22623 22944 E AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
01-09 15:46:11.149 551 3855 I OpenGLRenderer: Initialized EGL, version 1.4
Does anybody know what I have done wrong, or what can cause this error.
When I go form screen2 to screen1, I use Close screen2, simply going to the screen without closing just seems to make it worse.