Android Question Is an Specific activity open?

jvrh_1

Active Member
Licensed User
Hello!
When I am in a service, I need to know what activity is open.
Any ideas?
 

DonManfred

Expert
Licensed User
Longtime User
When I am in a service, I need to know what activity is open.
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
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…