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 7769377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:08:41+00:00 2026-06-01T16:08:41+00:00

I have an Android project with two activities. One is my main activity, using

  • 0

I have an Android project with two activities. One is my main activity, using a GLSurfaceView that gets updated from native code. The other is a PurchaseActivity that opens up Google’s In-App Billing client to make purchases. Making purchases works fine.

The problem I’m running into is that after the PurchaseActivity finishes, whether it completes successfully, errs, or is cancelled, and it switches back to the main activity, the EGL context disappears and I receive:

call to OpenGL ES API with no current context (logged once per thread)

After that the onSurfaceCreated() and onSurfaceChanged() methods are retriggered.

I found this question similar but mine is already running in a separate activity and if I remove the finish() call, it just remains stuck in the PurchaseActivity.

Do I really need to reload the textures after making an in-app billing call? It seems this shouldn’t be necessary at this point since the app is not being suspended.

My renderer code is pretty basic but for whatever reason, after the billing client window closes, it triggers a new surface and blows up my native code:

public class GameRenderer implements GLSurfaceView.Renderer
{   
    public void onSurfaceCreated(GL10 gl, EGLConfig config)
    { }

    public void onSurfaceChanged(GL10 gl, int width, int height)
    {
        BaseLib.setScreenSize(width, height);
        BaseLib.init();
    }

    public void onDrawFrame(GL10 gl)
    {
        BaseLib.render();
    }
}
  • 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-01T16:08:42+00:00Added an answer on June 1, 2026 at 4:08 pm

    Have you seen this thread?

    Prevent onPause from trashing OpenGL Context

    I would guess you get an onPause when you switch activities, which tells the GLSurfaceView to release resources.

    On API 11+ there is a command setPreserveEGLContextOnPause, but not sure if that’s a solution for you if you want to target lower API levels than that.

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

Sidebar

Related Questions

I have setup an android test project that runs junit tests. It's using two
I have two Android projects in Eclipse. I copied the one project from the
I have two projects, my main android application and another test project that runs
I have a project that uses two independent Android libraries. Each of them contains
I have two Eclipse projects: one that depends upon a certain library (android.jar) and
Background I have an Android project that has a database with two tables: tbl_question
I have an Android Eclipse project that I'd like to divide into two sub-projects.
I have an Android project that branched into three different applications, app-1 , app-2
I have come across a strange error. I have an Android project that uses
I'm using eclipse, and I have two android projects which have different topics. And

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.