Re-initializing Activity and Using Memory

Thank you for reading the question, although there really is one no-ish ...

How does the Android system manage memory in relation to the initialization of activity, especially if the operation is initialized with other actions? This has been a lingering question in my mind for a while, but I will try to illustrate with an example:

Let's say I have 3 actions - A , B and C - with activity A , which is the one that starts when the application starts for the first time. Now suppose that function A has buttons to go to actions B and C , and these actions are triggered using the Android function startActivity()that goes through this example Intent. Likewise, suppose actions B and C have buttons to trigger their cooperative actions ... is it still worth it?

Now, if I then use startActivity()for:

  • start activity B from activity A
  • then run operation C from step B
  • then run action A from activity C
  • then repeat the above steps unlimitedly (so go in circles)

... it would be fair to assume that the Android system would “know” that the actions had already been started earlier and would not reinitialize them and kill more and more memory, but rather call something like onRestart(), in order to quickly “switch” to an already initialized action instance?

/... , - ... , Android Android.

+5
1

: .: -)

A, B C, . , Android "Back Stack", , "".

, android:launchMode singleTop AndroidManifest.xml, Android , onNewIntent() .

Android Developer Documentation .

+7

All Articles