gpt4 book ai didi

java - Android - 当前正在运行的 Activity

转载 作者:行者123 更新时间:2023-11-30 03:38:27 24 4
gpt4 key购买 nike

我想制作一个将在后台运行并能够获取当前正在运行的 Activity 名称的 Android 服务。有谁知道如何做到这一点?

最佳答案

检查这个答案:https://stackoverflow.com/a/6881991/198996

Try using getRunningAppProcesses() to get a list of RunningAppProcessInfo. Then go through each RunningAppProcessInfo and check if it is in the foreground

关于java - Android - 当前正在运行的 Activity ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16247273/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com