Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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
    }
 
PREVIOUS NEXT
Tagged: #android #check #app #running
ADD COMMENT
Topic
Name
7+5 =