Basic Mode:
1. In firstactivity:
Intent intent = new intnet ();
Intent. setclass (firstactivity. This, secondactivity. Class );
Startactivity (intent );
2. add permissions to androidmanifest. xml.
</Activity Android: Name = "secondactivity"
Android: Label = "text"
</Activity>
3. secondactivity
Intent intent = getintent ();
To get what you need.
4. Flags attribute of intent
I. Relationship between activity and task (stack)
Task is like a container, and activity is equivalent to filling in the container. The first thing (activity) will be at the bottom, and the last added thing (activity) it will be at the lowest end. Retrieving an activity from a task is extracted from the top, that is, the last added activity is retrieved first, and so on, the last activity is added for the first time, and the sequence of the activity in the task is
Can be controlled, so intent flag is used for activity jump.
2. Intent is used for page Jump and service start. Intent flag is about activity jump.
Intent intent = new intent (this, XXX. Class );
// If the activity exists in the task, it gets to the top and does not start a new activity.
Intent. addflags (intent. flag_activity_brought_to_front );
// If the activity exists in the task, terminate all the activities on the activity.
Intent. addflags (intent. flag_activity_clear_top );
// The default redirect type. Place the activity in a new task.
Intent. addflags (intent. flag_activity_new_task );
// If the activity has been run to a task, the activity will not be running again
Intent. addflags (intent. flag_activity_single_top );