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.
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)**