A Alex_197 Well-Known Member Licensed User Longtime User Jul 19, 2024 #1 Hi all. I'm using this code created by Erel to check if my app is active or not. B4X: Copy 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.
Hi all. I'm using this code created by Erel to check if my app is active or not. B4X: Copy 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.
DonManfred Expert Licensed User Longtime User Jul 19, 2024 #2 Alex_197 said: o my question is if the screen timed out does it mean that the app is inactive or not? Click to expand... When the screen become dark the app is send to background. Due to this there is no visible activity. isAnyActivityVisible- i guess - will return false Upvote 0
Alex_197 said: o my question is if the screen timed out does it mean that the app is inactive or not? Click to expand... When the screen become dark the app is send to background. Due to this there is no visible activity. isAnyActivityVisible- i guess - will return false
Erel B4X founder Staff member Licensed User Longtime User Jul 21, 2024 #3 Switch to B4XPages. It will prevent your code from being paused. Upvote 0