isAppForeground

open fun isAppForeground(): Boolean

Return whether application is foreground.

Return

{@code true}: yes{@code false}: no

open fun isAppForeground(@NonNull() packageName: String): Boolean

Return whether application is foreground.

Target APIs greater than 21 must hold {@code }

Return

{@code true}: yes{@code false}: no

Parameters

packageName

The name of the package.