Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9213989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:52:34+00:00 2026-06-18T01:52:34+00:00

I’m making a game. Not long ago I had a problem. I wanted to

  • 0

I’m making a game.
Not long ago I had a problem. I wanted to preserve GLContext of GLSurfaceView for old sdk versions.
I’ve solved this problem by getting newest source of GlSurfaceView and putting it in my project. Just little fix was needed: gles 2.0 version check.

That works almost good. But!

On android versions 2.x.x When screen tuns of the application is destroyed and context and all textures along with it.
Interesting thing: if i’ll press home button and application will go to background and the turn of screen it wont be destroyed, but if i’ll turn of screen when it is running in foreground it will be destroyed for sure.

I’ve tried different approaches to avoid this.

  1. I’ve tried to separate context and surface threads as it was recommended by developers of replica island. But nothing good. It always reloads textures.

  2. I’ve tried to detach view n the onDestroy as was recommended here: Attach/detach Android view to/from layout but nothing good either.

  3. I’ve tried to use FLAG_SHOW_WHEN_LOCKED. But when screen is turned on the locker screen wont show up. And it will be shown when home button is pressed. Not good at all.

  4. I’ve tried to send app to background when on resume was called and then with BroadcastReceiver to bring it in foreground but it always is brought in foreground (even if it was in background). And if it was destroyed by system it wont be shown at all.

Don’t know what to do. May be my phone runs low on resources, but i’ve tried other games and they work perfectly fine. And restore themself without long reloading.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:52:35+00:00Added an answer on June 18, 2026 at 1:52 am

    I cant belive it. This is so stupid. According to this thread Problems understanding the life cycle when screen goes off and on you have to add

    <activity ... android:configChanges="orientation" ... >
    

    so the app wont be rotated and then destroyed when you will turn screen off.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have been unable to fix a problem with Java Unicode and encoding. The
I need a function that will clean a strings' special characters. I do NOT
I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I'm making a simple page using Google Maps API 3. My first. One marker
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.