3

I have seen so many related answers on SO but I couldn't have find any relevant solution.

Unfortunately, appname has stopped

I'm developing this app in which there are lots of images required and I am getting them from drawable folder and it runs fine... but later after some time, when I scroll the list view, I get the app crashes.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Viraj Mohite
  • 308
  • 1
  • 13

1 Answers1

0

The images you are using are too large in size and makes your application heavy. Use some compressor to compress images and then use.

Kanwaljit Singh
  • 4,339
  • 2
  • 18
  • 21
  • Thank you,Yeah images are too large, but after compression its too blur as well as it doesn't fit to imageview at all... Do you have any solution for that?? – Viraj Mohite Jan 11 '17 at 04:33
  • Try any of these compressor https://www.google.co.in/search?site=&source=hp&ei=NLd1WKz_DsXrvATI7424CA&q=compress+images+without+losing+quality&oq=compress+images+wi&gs_l=mobile-gws-hp.1.0.0l5.79.5876.0.8512.19.18.0.6.6.0.1334.8242.2-6j4j2j2j1j2.17.0....0...1c.1j4.64.mobile-gws-hp..6.13.2712...35i39k1j0i131k1.yZsjbzcxrjA – Kanwaljit Singh Jan 11 '17 at 04:41
  • And to fit to imageview try the solutions in this post http://stackoverflow.com/questions/8232608/fit-image-into-imageview-keep-aspect-ratio-and-then-resize-imageview-to-image-d – Kanwaljit Singh Jan 11 '17 at 04:55
  • If still any problem let me know. – Kanwaljit Singh Jan 11 '17 at 04:55
  • Thnx, It's working...okay, I've one more question in mind...m just curious,maximum how many images should we take or keep in drawable folder(depend on size!!?? or anything else??)... which are best practices for that?? – Viraj Mohite Jan 11 '17 at 05:08
  • Your answer is how many images your application required. But keep in mind images are not so large. Avoid any image you are not required in your application. Also reduce images size you are using. – Kanwaljit Singh Jan 11 '17 at 06:02