简体   繁体   English

Android System杀死App Activity休闲

[英]Android System kill App Activity recreation

If i have on my Nexus 5 more than 18 Apps open, then my app disappears from the app history and is killed from the system. 如果我在Nexus 5上打开了18个以上的应用程序,则我的应用程序将从应用程序历史记录中消失,并从系统中被杀死。 I start my app from the springboard (i dont know how it called by android) and my splashscreen activity is started. 我从跳板启动我的应用程序(我不知道它是如何被android调用的),并且启动了我的启动画面活动。 After this my mainactivity is started but android wants to recreate the mainactivity (Bundle is not null). 此后,我的mainactivity已启动,但android要重新创建mainactivity(Bundle不为null)。 The activity have a viewpager and some menu items, but the recreation takes a long time and the user see a blank activity with a actionbar. 该活动具有Viewpager和一些菜单项,但是重新创建需要很长时间,并且用户会看到带有操作栏的空白活动。

What is the best practice to recreate a activity? 重新创建活动的最佳实践是什么? I find only simple examples with one textview and one edittext. 我只找到带有一个textview和一个edittext的简单示例。 But my activity is complex with fragments inside the viewpager and some other controls. 但是我的活动很复杂,其中有viewpager和其他控件内部的片段。

And yes i have read this article http://developer.android.com/training/basics/activity-lifecycle/recreating.html 是的,我已经阅读了这篇文章http://developer.android.com/training/basics/activity-lifecycle/recreating.html

What is the best practice to recreate a activity? 重新创建活动的最佳实践是什么?

Do it faster. 更快地做。

But my activity is complex with fragments inside the viewpager and some other controls. 但是我的活动很复杂,其中有viewpager和其他控件内部的片段。

Use Traceview to determine where your performance problem lies. 使用Traceview确定性能问题所在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM