A series of activities form a back stack based on the order in which activities were opened. The back stack is popped when Back is triggered on the system. Resuming an app will restore the existing back stack, while a freshly started or oldest activity in the stack will Back into the system Home screen.
the onBackPressed()
method can be overridden to adjust behavior for background “warm” state instead of termination.
The same activity may be present multiple times in the back stack for each instance if the app’s structure allowed for this sequence.
The default activity behaviors may be altered or interrupted with attributes for the <activity>
element as well as flags for an intent (when transitioning from one activity to another).
New activities begin either from a defined manifest behavior (in the launchMode
attribute) or the startActivity()
method and the associated Intent
(when the two interact, an intent superscedes a manifest)
getSharedPreferences()
and getPreferences()
are used for file access that is available across your app or for a particular activity, respectively. getPreferences()
does not require that a file name be specified.