Answers for "android check if app is running"

2

android check if app is running

private fun isAppRunning() : Boolean {
        val services = (getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager).runningAppProcesses
        return services.firstOrNull{it.processName.equals(packageName,true)} != null
    }
Posted by: Guest on August-03-2020

Code answers related to "android check if app is running"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language