Android Question A sudden blackness to the screen

sortec.nick

Member
Licensed User
Longtime User
Dear community,


The screen goes black occasionally while running my app on the Samsung Galaxy 10s we have for development.


The occurrences of this seem random to me, but this has only happened in the application that I have created.


It will happen once in a blue moon (once or twice a month), which is often enough for it to be a concern, but infrequent enough to understand why it happens.


Specifics:
  • This has happened on four different Samsung Galaxy 10s now
  • Nothing appears in the log when it happens.
  • When the screen goes blank, it is instant with no animation.
  • Amidst the black, the program is still running fine in the background.
  • Three presses of the power button restores the application.
  • It's as if the back-light is told to switch off.
  • It doesn't appear to matter which activity is currently in focus when it happens.


Has anybody else had this problem, or could maybe shed some light on the problem?


I really don't know what is causing this phenomenon.
 
Last edited:

mc73

Well-Known Member
Licensed User
Longtime User
Are you using any subroutine which occasionally takes a bit of time to complete? For example, some sql libs can cause this effect, since they don't allow the main thread to proceed.
 
Upvote 0

sortec.nick

Member
Licensed User
Longtime User
Are you holding a KeepAlive lock? Otherwise the screen is allowed to turn off.

No, there's no KeepAlive. In this case, the system doesn't go into stand-by as it usually would. Instead, the screen flicks off instantly. Meanwhile, the program is running in the background. It's also worth noting that OnPause has not been called and no exceptions are thrown.

To restore the app, pressing the power switch (On a Samsung GT-N8000) once triggers the OnPause function, and pressing a second time turns the screen back on and either triggers the OnResume method or displays the "Swipe the screen" welcome screen.
 
Upvote 0
Top