Android - singleTask mode question

after viewing the section "Defining startup modes" of the Tasks and Reverse Flow manual, I don’t understand exactly the behavior of the activity declared using "singleTask".

Suppose I run singleTask-activity (via the startActivity method) when there is an instance of this activity lying below (the root activity) of the background task,

as described in the article, the Intent that I use to run singleTask-activity will be delivered to the instance, in which case will the instance return to its task and its tasks in the foreground, or simply lead to its task before proceeding with its task?

Am I cleared up? Help pls! thanks in advance

+3
source share
3 answers

. , stackoverflow , , , , , singleTask.

, , .

:

: A: singleTask, Activity B: standard

1

  • A; stack: [A]
  • B A; stack: [A | B]
  • ; stack: [A | B]
  • A ; : [A] (onDestroy B onResume() A)

2

  • A; stack: [A]
  • B A; stack: [A | B]
  • A B; : [A] (onDestroy B onResume() A)

android:alwaysRetainTaskState="true", , , 10 , :

, . , . , , , , , - .

Tasks and Back Stack.

, .

+7

Activity , onNewIntent() Activity. Activity Intent, onResume() onNewIntent(). , onResume() , Activity .

0

FLAG_ACTIVITY_CLEAR_TOP Single Task?

, FLAG_ACTIVITY_CLEAR_TOP , , , ?

0

All Articles