When we work with different apps in Android, there are many activities, processes or other components
alive.
At the same time, the state or life cycle of these components differs based on which screen the user
is interacting with.
Android manages all these lifecycle and state changes through Amos.
Amos users mainly do data structures to handle these folders.
Activity record and task activity record is the base data structure, which records the characteristics
of a single activity tasks is basically a collection of multiple activity records.
So let's have a closer look at these two data structures and its associated classes.
Activity record is the basic data structure of AMS.
It records the static characteristics of activity defined in Android Manifest XML.
It also records the state changes of the activity.
So an activity record has many attributes.
Here are a few of them.
These are basically defined within activity record or Java.
So here are a few of the activity record attributes.
The first one Activity Info.
The activity info corresponds to the information collected from the Android manifest stored XML activity
and receiver tags.
So these are the same information which are there in the Android manifest or XML in your project under
the activity and the receiver XML tags M activity type.
So this contains the type of the activity.
There are different types of activity like standard home reasons, assistant dream activity.
There is also an undefined activity type app token app token is an ID of the current activity record
package name is the package name where this belongs to.
This is statically defined within the activity stack process name.
Process name is again defined in the activity tag in manifest or XML task affinity.
So different activities with the same task affinity are assigned to the same task stack.
So based on the task affinity, the activities are put into different tasks indent the start indent
for the current activity launched from UID.
So this is basically the UI idea of the initiator launched from package.
So this is the initiators package name the cell to sell two represents the last activity record that
started it.
And when another activity record needs to be started, it passes itself as result to the next activity
record in state.
The state of the activity record with an initial value of activity state initializing.
So this depends upon the user interaction of different apps.
So the states change based on the user interaction app is the host process of the activity record task
task is the host task of activity record in history.
So this identifies whether the current activity record has been placed on the task collection, new
intents intended for temporally storing intent that has not yet been scheduled to the application process
activity.
So these are a few of the attributes that the complete list of attributes of the activity record.
Please have a look at the activity record of Java and here are a few methods which are used by activity
record to maintain the behavior but take from history and ease in history.
These are based on the in history attribute, determine and update the status value of activity record
in the task stack.
Get display ID.
This display is the ID to which this record is attached to deliver new intern log is deliver a new intent
to an existing activity so that its own new indent method will be called at the proper time.