How we can use onNewIntent() in any Activity?

前端 未结 3 1997
逝去的感伤
逝去的感伤 2020-12-13 06:05

What is the real use of onNewIntent() in the activity life cycle and how do we use this method?

3条回答
  •  执念已碎
    2020-12-13 06:28

    This is called for activities that set launchMode to "singleTop" in their package, or if a client used the FLAG_ACTIVITY_SINGLE_TOP flag when calling startActivity(Intent).

    If you set to single top, the activity will not be launched if it is already running at the top of the history stack. It will not relaunch just show from stack.

提交回复
热议问题