Hi all.
I'm using this code created by Erel to check if my app is active or not.
I also have a timer ticking every minute is Service that checks if the app is not active and if not it counts to 30 and redirects the user back to the login screen. It works like on the web site.
What I've noticed - if the user starts another app and returns to the app 30 minutes later he needs to login back to the app. But if the user just left the phone on the table and the screen timed out (gets dark) and when the user returns back to the app even 1 hour later he can see the same screen he was 1 hour ago and doesn't need to login back.
So my question is if the screen timed out does it mean that the app is inactive or not?
Thanks.
I'm using this code created by Erel to check if my app is active or not.
B4X:
Sub IsAnyActivityVisible As Boolean
Dim jo As JavaObject
Return jo.InitializeStatic("anywheresoftware.b4a.BA").RunMethod("isAnyActivityVisible", Null)
End Sub
I also have a timer ticking every minute is Service that checks if the app is not active and if not it counts to 30 and redirects the user back to the login screen. It works like on the web site.
What I've noticed - if the user starts another app and returns to the app 30 minutes later he needs to login back to the app. But if the user just left the phone on the table and the screen timed out (gets dark) and when the user returns back to the app even 1 hour later he can see the same screen he was 1 hour ago and doesn't need to login back.
So my question is if the screen timed out does it mean that the app is inactive or not?
Thanks.