Does too many Acts affect my work?

So, I have almost 20 types of activities, because I have almost 20 layouts in which information is important (regarding the contents of the application). Well, I have to say that these actions basically have TextViews.

Is there something like "Stack" where actions can be taken? If there is a stack, does this affect performance when the application starts? How can I see this stack?

Is there a rule about how much work the application should have or depends on the purpose of the application?

It would be nice if you could explain to me how events are held or how they are processed when my application starts. Because I do not want these 20 actions to affect my work.

+4
source share
4 answers

These 20 actions will only affect your apk size. But if they only have a TextView, it will not be significant.

If the user moves through all 20 actions and is stored on the stack, something like activity A triggers activity B, which triggers activity C ..., your activity stack will be too large, and probably the android will destroy the oldest on free resources. It is very important that you implement the entire life cycle of the activity and save the data in the package, so when the user returns to your activity, you can recreate it from scratch in the same state as before.

- EDIT -

@CommonsWare , Android , , , , : https://commonsware.com/blog/2011/10/03/activities-not-destroyed-to-free-heap-space.html

+2

:

- "Stack", ? , ? ?

, , . , .

, , . - back stack) - , . , , . , . . "", . .

: https://developer.android.com/guide/components/activities/tasks-and-back-stack.html

:

, ? ?

, Activits, , . , , . .

+3

, , . , , / , .

+2

It depends on how you use them. If you study the life cycle of actions on

Activity Life Cycle

You will see that if you hold many actions on the stack, you will lose performance, but if you destroy them, you will not. You will simply affect the size of the APK.

+1
source

Source: https://habr.com/ru/post/1680564/


All Articles