This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

My Android (Java) app experiences random "black screens"

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I have a POS system built in Java/Android. In my development environment, this never happens, but my clients are experiencing occasional "black screens". It happens on random activities/fragments and there is no crash error. The screen just turns black, you can see the android time and status on the top right. Users need to close out all apps and then return to the app and everything is fine again.

I have gone through all the warnings on these pages and cleaned up various possible memory leaks but I would think if it WAS a memory leak we would get an error. I have no idea on how to diagnose what is going on. What are the possibilities here? Could it be a memory leak? It's happening on different tablets (Galaxy Tab A 10.1) so I have ruled out a defective unit. All of my web service calls are done async...

What should I do to fix an error that I can't reproduce and doesn't cause a crash?
 
Saloon Keeper
Posts: 5696
144
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've had odd things happen in apps of mine when onRestart was being called in the lifecycle rather than onCreate (see https://developer.android.com/guide/components/activities/activity-lifecycle for details). My solution in those cases was to finish the activity in the onRestart handler, and fire an Intent to restart it immediately. Something like this:


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!