Android:应用程序的所有活动具有相同的横向视图
我正在构建一个 Android 应用程序。它总共包含十项活动。所有活动均针对纵向模式构建。要求所有活动在横向模式下,应显示相同的遮流效果。 我们可以通过 onConfigChange 方法来做到这一点,但问题是,在实现 coverflow 效果时,每次都会消耗大量内存,并且系统会崩溃。可能是某处存在内存泄漏问题。
所以,我想知道是否有任何简单的技术,使系统不会崩溃并具有平滑的方向?
谢谢。
I am building an android application. It contains total ten activities. All activities are build for portrait mode. Requirement is that in landscape mode of all the activities, same coverflow effect should be displayed.
We can do that through onConfigChange method, but the problem is that in implementing a coverflow effect everytime consumes a lot of memory and system gets crashed. Might be somewhere memory leak problem.
So, i am wondering that is there any simple technique, so that system does not get crashed and have smooth orientation?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
防止内存泄漏是构建应用程序的一种方法。当您知道它时,这很简单: http://android-developers .blogspot.com/2009/01/avoiding-memory-leaks.html
简而言之:
Application
类中(每个应用程序都有一个,并且不会在方向更改时被破坏)。您还可以创建自定义图像缓存类。以目标分辨率加载图像(解码时调整大小) 带有
inSampleSize
选项:Preventing memory leaks is an approach to building your app. It's simple when you know it: http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html
In a nutshell:
Application
class (which is one per app and does not get destroyed on orientation change). You could also make custom image cache class.Load images in their target resolution (resize when decoded) with
inSampleSize
option: