What exactly does Android – movetasktoback() do?

From documentation:

What exactly does "move the task containing this activity behind the activity stack" mean? I know that each task is a pile of activities, but according to the above sentence, there seems to be a pile of global tasks?

When I try this method, the current activity will be moved to the background and the behavior will look very similar to when I click the home button (for example, the activity has not been destroyed and can be restored later). Is there any difference between calling this function and pressing the home key?

resolvent:

There is no global task stack. This is a global activity stack, which can come from an application or from multiple applications. Suppose you have an application, you can click the link to bring you to the browser. If the browser then calls the moveTaskToBack () method, the original application activity will be opened, and the previous activity on Backstack will still exist.

Now imagine that instead of calling the movetasktoback() method, the user presses the home button. Now, pressing "back" on the phone will not bring you back to the original application. You just need to stay on the home screen

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>