这是初学者最问的问题之一,但我仍然无法得到任何帮助,可惜。在活动我有一个viewflipper到我指定imageviews与图像编程(约100张图像添加使用for循环viewflipper)。可能是由于图像尺寸或由于大量无图像,我得到了位图内存溢出错误。我的问题是:
This is one of the most asked question by beginners but still I couldn't get any help unfortunately. In an activity I have a viewflipper to which I assign imageviews with images programatically ( around 100 images added to viewflipper using for loop ). Might be due to image size or due to the large no of images I get OutOfMemory Error for bitmaps. My Questions are:
如果这是因为我可绘制采取的内存空间,有没有办法通过它我可以释放被他们所占据的空间? 可垃圾收集是这个原因?如果是的话有什么解决办法? 由于我使用的是viewflipper,有没有办法通过它我可以只装我现在,previous和viewflipper的下一个视图?这是否会帮助占用更少的内存?请让我知道如果我的问题是混淆或不理解的。这是一个重要的话题对我来说,因为我几乎所有我的应用程序面临这样的问题。
Please let me know if my question is confusing or is not understandable. This is an important topic to me as I am facing this problem in almost all my apps.
推荐答案
要避免在清单使用这种AQUIRE一大堆:
to avoid,aquire large heap using this in manifest:
android:largeHeap="true"
和几乎所有问题的解决方案是在与内存出这些错误链接present,希望他们中的一个可能解决您的问题:
and almost all problem solutions are present on these links related to memory out of error,hope that one of them may solve your problem:
meomry-out-of-error
Memory泄漏和Out的使用清单,LinkedList的内存错误而HashMap
内存泄漏和Out的使用LRU内存错误缓存
Memory泄漏的使用内存错误磁盘LRU缓存
相关推荐
最新文章