memory - Android OutOfMemory error ImageView -


  java.lang.outofmemoryerror: failed allocate 14400012 byte allocation 5645520 free bytes , 5mb until oom             @ dalvik.system.vmruntime.newnonmovablearray(native method)             @ android.graphics.bitmapfactory.nativedecodeasset(native method)             @ android.graphics.bitmapfactory.decodestream(bitmapfactory.java:726)             @ android.graphics.bitmapfactory.decoderesourcestream(bitmapfactory.java:547)             @ android.graphics.drawable.drawable.createfromresourcestream(drawable.java:1014)             @ android.content.res.resources.loaddrawableforcookie(resources.java:3730)             @ android.content.res.resources.loaddrawable(resources.java:3603)             @ android.content.res.resources.getdrawable(resources.java:1852)             @ android.content.context.getdrawable(context.java:408)             @ android.view.view.setbackgroundresource(view.java:17228)             @ alexcz.shapetest.test.nextq(test.java:89)             @ alexcz.shapetest.test$1.onclick(test.java:54) 

error ^^

the error occurs when of onclick events triggered. other images show except these 2. both these images not big , around 600x600. in code error occurs at

nextq.setbackgroundresource(r.drawable.nextq); result.setbackgroundresource(r.drawable.correct);  

thanks in advance.

github:https://github.com/alex578344/shapetestlogic

android:largeheap ="true" 

not panacea, , recent method of optimization. explore this official guide learn more.

i recommend replace imageview subsampling-scale-image-view. convenient , fast library compatible imageviewinterface. ship picture in parts, excludes exception.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -