java.lang.OutOfMemoryError:位图大小超过VM预算 - 机器人 - 多少图像? [英] java.lang.OutOfMemoryError: bitmap size exceeds VM budget - android - how many images?

查看:160
本文介绍了java.lang.OutOfMemoryError:位图大小超过VM预算 - 机器人 - 多少图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序,当我读到各地和教训为我自己,我不能有很多在屏幕上的图像在同一时间或我会得到一个异常。

I am developing an android app and as I read all around and learned for myself, I cant have a lot of images on the screen at the same time or I will get an exception.

现在的问题是/图像可我也同时在屏幕上。

The question is how many images or how many KB in images or how many layouts/images can I have at the same time in the screen.

我知道这是不是对记忆的影响的唯一的事情,但我找了几次,所以我可以围绕它的计划。

I know this is not the only thing that has influence on memory, but I am looking for a number so I can plan around it.

感谢

丹尼尔


编辑:

我刚刚发现这对Android开发人员网站(的http://开发商。 android.com/resources/articles/future-proofing.html

I just found this on the android dev site (http://developer.android.com/resources/articles/future-proofing.html)

技术,避免,#3:去过分使用布局

Technique to Avoid, #3: Going Overboard with Layouts

由于变化的视图显示基础设施,布局不合理的深层(大于10左右)或宽(超过30个)查看层次结构现在可能造成死机。这始终是过于复杂的布局风险,但你能想到的Andr​​oid 1.5的比1.1更是揭露了这个问题。大多数开发者不需要担心这个问题,但如果你的应用程序有非常复杂的布局,你需要把它放在一个饮食。您可以使用像的FrameLayout和TableLayout更先进的布局类简化你的布局。

Due to changes in the View rendering infrastructure, unreasonably deep (more than 10 or so) or broad (more than 30 total) View hierarchies in layouts are now likely to cause crashes. This was always a risk for excessively complex layouts, but you can think of Android 1.5 as being better than 1.1 at exposing this problem. Most developers won't need to worry about this, but if your app has very complicated layouts, you'll need to put it on a diet. You can simplify your layouts using the more advanced layout classes like FrameLayout and TableLayout.

我想这可能是我的问题。

I guess this can be my problem.

当它说:广义,是说在最后一个级别?

When it says 'broad' , is it saying on the last level ?

感谢

丹尼尔

推荐答案

这答案有2件

1)它不是多少的图像画面了,但作为小心在完成活动时,清理一切行动

1) its not how much images the screen has, but being carefull on cleaning everything up when finishing the activity

2)( 未来-Proofing您的应用程序

技术,避免,#3:去过分使用布局

Technique to Avoid, #3: Going Overboard with Layouts

由于变化的视图显示基础设施,布局不合理的深层(大于10左右)或宽(超过30个)查看层次结构现在可能造成死机。这始终是过于复杂的布局风险,但你能想到的Andr​​oid 1.5的比1.1更是揭露了这个问题。大多数开发者不需要担心这个问题,但如果你的应用程序有非常复杂的布局,你需要把它放在一个饮食。您可以使用像的FrameLayout和TableLayout更先进的布局类简化你的布局。

Due to changes in the View rendering infrastructure, unreasonably deep (more than 10 or so) or broad (more than 30 total) View hierarchies in layouts are now likely to cause crashes. This was always a risk for excessively complex layouts, but you can think of Android 1.5 as being better than 1.1 at exposing this problem. Most developers won't need to worry about this, but if your app has very complicated layouts, you'll need to put it on a diet. You can simplify your layouts using the more advanced layout classes like FrameLayout and TableLayout.

丹尼尔

这篇关于java.lang.OutOfMemoryError:位图大小超过VM预算 - 机器人 - 多少图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆