I encountered a problem when I was working on my application that I needed to preload some data when I started the main page, I was working on a load page and then went to the main page, but when I pressed the back key in the main page, the system returned to the loading page. I don't want the load page to remain in the task after it's been used. The default relationship for return stacks, tasks, and Activity as described in the official Android documentation: 1: When activity B is started from activity A, activity a stops, but saves its state (for example, scrolling position and text in the form). If the user presses the return key in activity B, activity a reverts to the previous state; 2: When the user presses the home key, the current activity stops and its task is placed in the background. The system will save the status of each activity in the task, and if the user launches the app again, the task will return to the foreground and show the activity;3 at the top of the stack: if the user clicks the back key, the current activity is popped out of the stack and destroyed. If the activity is destroyed, the system does not save its state; 4:activity can be instantiated many times, even from different tasks.
Of course you can change its default state by adding a flag to the manifest file or to the intent that launches the activity.intent.setflags (intent.flag_activity_no_history);//The newly started ACTIVITY will not be saved in the history stack
introduce a common flag:Flag_activity_new_task: The newly launched ACTIVITY will open a new task in this historical stack
You can find the logo you need in the intent class in the documentation.
return keys and activity in Android