Is app closed,Paused or not active ?

SoyEli

Active Member
Licensed User
Longtime User
Hello:

How can I test from a service if app is closed,Paused or not active ?


Thank you:
 

SoyEli

Active Member
Licensed User
Longtime User
Thank you for the reply:

What is it is close ( not running at all ) ?
in other wards I want to know if it is "Closed,Paused,active".

Thank you again :)
 
Upvote 0

rbsoft

Active Member
Licensed User
Longtime User
From the B4A documentation:

IsPaused (Component As Object) As Boolean

Tests whether the given component is paused. Will also return true for components that were not started yet.
Example:

If IsPaused(Main) = False Then CallSub(Main, "RefreshData")

It doesn't seem to make a difference if the activity is not started yet, paused, or terminated. It is not active. So there is a variety of things you can do.

B4X:
If IsPaused(Main) Then
   'Show a message
   ToastMessageShow("Activity Main is not active", True)
   'Wake the activity up
   StartActivity(Main)
   'or any other action
End If


Rolf
 
Upvote 0
Top