One scenario in which the foreground task process ends is that in multi-window mode, your task is in one window, and the user in another window goes into settings and removes some resolution. However, at this moment the whole process disappeared; Activity B would be visible in the foreground to this point, but then disappeared.
And, if the device undergoes a configuration change while the action B is in the foreground, then presses BACK or, otherwise, goes to Activity A, by default, Activity A will be destroyed and recreated ... but at that moment Activity B is not longer in the foreground.
And, of course, you can force Activity A to be destroyed by calling finish() on it.
Therefore, given my interpretation of your question, the answer is "no, if you do not call finish() , action A will not be destroyed, and action B is still in the foreground."
CommonsWare May 31 '17 at 14:07 2017-05-31 14:07
source share