Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
814 views
in Technique[技术] by (71.8m points)

performance - Whats the main advantage and disadvantage of "do not keep activities" in android

One query I would like to have if anyone could answer it like: Do not keep activities options to be checked during testing android mobile application from developers options.

I used it in my application and found that my application behaves inappropriately and crashed when I switched ON Do not keep activities in android.

My questions were few :

1: How much this option will affect mobile applications?

2: What exactly does this do?

It sounds like an app killer,I notice in the Developer Options there is a box that says Do not keep activities - destroy every activity as soon as the user leaves it .

Does this create any positive and or negative functionality on my apps?

Does that mean if I open an app and as soon as I leave it, it actually closes that app and I wouldn't see it in the task manager to manually kill it? If so, isn't this a good thing to keep the RAM usage low?

What were the advantages and disadvantages of using it while keeping Do not keep activities ,Kindly share the experience on it.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

How much this option will affect mobile applications?

If they are well writen this option will not affect them.

What exactly does this do?

If you have this option turned on only variables kept in activity with method onSaveInstanceState will be saved when you go to another activity or app goes in background. All other variables will be removed immediately. When this option is off there is possibility that these variable will be kept

Does that mean if I open an app and as soon as I leave it, it actually closes that app and I wouldn't see it in the task manager to manually kill it?

No it means that all not kept variables will be removed. When you in example press home button.

Does this create any positive and or negative functionality on my apps?

No it only helps to develop application properly. It helps to predict unexpected situations.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...