You know what activities are available. You need to get rid of them.
B4X:
If IsPaused(Main) = False Then ' Main is the Activity to check.... Do it for all your activities.
Log("Main is Showing")
End If
Edit to add:
B4X:
public Sub Activitycheck()
Dim Activities() As Object = Array(Main) ' Add all your activities to this array
For Each Act As Object In Activities
If IsPaused(Act) = False Then
Log($"${Act} is Showing"$)
End If
Next
End Sub