【发布时间】:2021-12-27 07:13:13
【问题描述】:
我有一个活动 A,它启动自定义选项卡。当自定义选项卡打开时,我需要知道任务(活动所属的任务)是进入后台还是进入前台。
我知道这个问题How to detect when an Android app goes to the background and come back to the foreground。这个问题提到的解决方案对我不起作用,因为一旦启动自定义选项卡,就会收到 onbackground 回调,这不是我想要的。当包含活动 A 的任务进入后台时,我想要 onbackground 回调。
【问题讨论】:
-
自定义标签是什么意思?您是在谈论您的活动启动片段吗?
-
@DankyiAnnoKwaku developer.chrome.com/docs/android/custom-tabs
标签: android android-lifecycle lifecycle chrome-custom-tabs android-customtabs