📌  相关文章
📜  android 检查应用程序是否正在运行 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:02.462000             🧑  作者: Mango

代码示例1
private fun isAppRunning() : Boolean {
        val services = (getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager).runningAppProcesses
        return services.firstOrNull{it.processName.equals(packageName,true)} != null
    }