Bug? B4XPages strange lifecycle with screensaver

Mike1970

Well-Known Member
Licensed User
Longtime User
I noticed something strange while dealing with the Screensaver.

When starting the screensaver this is the pages behavior

B4X:
Screensaver now
** Activity (main) Pause event (activity is not paused). **
*** home: B4XPage_Disappear [home]
*** mainpage: B4XPage_Background [home]
** Activity (main) Resume **
*** mainpage: B4XPage_Foreground [home]
*** home: B4XPage_Appear [home]
[RESET] - Screensaver Timer
** Activity (main) Pause event (activity is not paused). **
*** home: B4XPage_Disappear [home]
*** mainpage: B4XPage_Background [home]
[RESET] - Interaction Timer


why there is Disappear/Background, Appear/Foreground (why?) and then finally Disappear/Background again?
 

Mike1970

Well-Known Member
Licensed User
Longtime User
Doesn't look like a bug. Android has paused the activity and then resumed it and paused it again. This is the OS behavior.
Yes, but actually if you look at the screen while all of this happens nothing strange is visible... it just starts the screensaver...
So I expect only to have this behaviour when SS starts
  • Screensaver starts > Background (Activity_Pause)
And this when I tap on the screen to wake up the device
  • Foreground (Activity_Resume)
Why, before going in standby, it pauses, resumes, and pauses again itself?
This then reflects to the corresponding subs in the code... resulting in graphical glitches while the device fades in standby (screensaver).

I attach a sample code that just starts the SS with a button.
B4X:
Screensaver now
** Activity (main) Pause event (activity is not paused). **
*** mainpage: B4XPage_Disappear [mainpage]
** Activity (main) Resume **
*** mainpage: B4XPage_Appear [mainpage]
** Activity (main) Pause event (activity is not paused). **
*** mainpage: B4XPage_Disappear [mainpage]
** Service (starter) Destroy (ignored)**
 

Attachments

  • Screensaver_Test.zip
    10.1 KB · Views: 38
Top