android - Out of Memory Error when Loading Images from Mipmap folder -


logcat fatal exception: main process: com.example.markpalmer.blackjack21, pid: 21864 java.lang.outofmemoryerror: failed allocate 5808012 byte allocation 5226696 free bytes , 4mb until oom

hi, know there posts regarding this, don't understand answers. error random, , occurs when setting imageview:

ivplayercard3.setimageresource(picp3);

the images not large: 36kb, 500x700 .png files. thing no particular reason have put them in res>mipmap-hdpi folder. reason problem. shifting them drawable folder help? many in advance.

why don't try setting thee imageresouce using known libraries picasso check doc here

picasso handles oom loading image in segments or fractions. moving them drawable might mipmap creates map of image, better solution use picasso hope helps!


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -