The problem arises if the app loses focus once. Once it regains focus the screen background is always black. This happens in both an .apk and the AppGameKit Player
Note that the player app just has to lose focus once, and once that has happened even new broadcasts suffer the problem. To get SetScreenColor() to work again one has to exit the player
and start it again. (This is why yesterday I thought the Player was behaving differently to an .apk)
My sample code includes three buttons to show that SetScreenColor() does indeed (repeatedly) work initially.
// some buttons to change the screen color at run time
swap() // additional attempt to force it for blue
EndIf // red
EndIf // green
EndIf // blue
To witness the problem;
1) broadcast the code to Android (or install an apk of it)
2) click on the three buttons, background will change accordingly.
3) Switch away from the app
4) Switch back
On my Pixel 4a running Android 12, the screen is already black at that stage.
If you tap any of the buttons you see they change their shade as if
the background had changed. This tells us that the button code is being executed.
does not make a difference.
Perhaps this is a new behavior with Android 12 that people have not ben running into this problem more.