android loadIcon generates outOfMemoryError

后端 未结 2 1853
北恋
北恋 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: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.

提交回复
热议问题