foreground

fun foreground(uiAutomation: UiAutomation, packageName: String): Boolean

Checks if the app with the given packageName is in the foreground, re-using the applications function.

Return

True if the package is in foreground

Parameters

uiAutomation

The automation instance used for automated testing

packageName

The package of the app