android loadIcon generates outOfMemoryError

后端 未结 2 1830
北恋
北恋 2021-01-16 04:46

I just have a little ListView containing all installed apps and their icons
but if there are too much Apps installed i run into outOfMemoryErrors

相关标签:
2条回答
  • 2021-01-16 05:22

    Resize your icons into small images, you will be fine! (had this problem before, too)

    0 讨论(0)
  • 2021-01-16 05:39

    Solved it myself.
    I'm now loading every image into a cache before using it.
    If the cache gets full, the oldest element will be discarded,
    so new ones can get cached. additionally im resizing my images into smaller icons.
    that did it.

    0 讨论(0)
提交回复
热议问题