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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:50:34+00:00 2026-06-04T03:50:34+00:00

[EDIT: FIXED! The problem appears to be having an invisible VideoView overlaying my GLSurfaceView

  • 0

[EDIT: FIXED! The problem appears to be having an invisible VideoView overlaying my GLSurfaceView in the layout xml. Removing the VideoView from the layout restores the expected behavior.]

[EDIT #2: Making the GLSurfaceView use ARGB888 ought to also fix this (cannot mix surfaces with different color formats I presume), have since done that to show GL over video.]

I’m using a GLSurfaceView successfully, but am seeing a strange problem on an Android 3.2 tablet. The GLSurfaceView activity uses the AndroidManifest to force landscape orientation. If I start it from an existing activity in portrait orientation the screen rotates and the GLSurfaceView works as expected. If I start it from an activity in landscape orientation the GLSurfaceView is black. This is not just a texture problem, neither glClearColor nor filling solid triangles via glDrawArrays are visible.

  • If I rotate the screen (manually after removing the manifest directive, or via setRequestedOrientation with or without the manifest directive) it starts working.

  • If I press the back button I see the expected rendered GLSurfaceView for a moment as the activity exits.

  • If I start a new activity (a SettingsActivity), I see the expected rendered GLSurfaceView flicker for a moment when starting the new activity and when returning to the GLSurfaceView activty by pressing the back button (then the screen goes black again), but only if the device is in landscape orientation. If I put the device in portrait mode then start my settings activity I do not see the GL flicker, but rotate to portrait before pressing back I do see the flicker when the GLSurfaceView activity resumes.

  • I do not see this behavior in the emulator nor on an Android 4.0.4 phone.

I create the GLSurfaceView in onCreate and add it to a FrameLayout in my layout xml.

I’m calling the GLSurfaceView pause and resume methods from the corresponding activity methods. Here’s my onSurfaceCreated and onSurfaceChanged handlers:

public final static void onSurfaceCreated(GL10 pGL) {
    pGL.glClearColor(0.5f, 0.5f, 0.5f, 1f);

    pGL.glEnable(GL10.GL_TEXTURE_2D);

    pGL.glEnable(GL10.GL_BLEND);
    pGL.glBlendFunc(GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA);

    pGL.glShadeModel(GL10.GL_FLAT);
    pGL.glDisable(GL10.GL_DEPTH_TEST);

    pGL.glDisable(GL10.GL_DITHER);
    pGL.glDisable(GL10.GL_LIGHTING);
}

public final static void onSurfaceChanged(GL10 pGL, int pWidth, int pHeight) {
    pGL.glViewport(0, 0, pWidth, pHeight);

    pGL.glMatrixMode(GL10.GL_PROJECTION);
    pGL.glLoadIdentity();
    pGL.glOrthof(0f, pWidth, 0f, pHeight, -1f, 1f);
    pGL.glMatrixMode(GL10.GL_MODELVIEW);
}

Here’s how I set up the GLSurfaceView:

    mGLSurfaceView = new GLSurfaceView(pContext);
    mGLSurfaceView.setEGLConfigChooser(false);  // no depth buffer

    mGLSurfaceView.setRenderer(this);
    mGLSurfaceView.setDebugFlags(GLSurfaceView.DEBUG_CHECK_GL_ERROR);

I added logging to verify onSurfaceCreated and onSurfaceChanged (with the expected size), as well as onDrawFrame is being called.

I found a similar report from someone using a GLSurfaceView inside a TabHost, but no good resolution: https://groups.google.com/forum/?fromgroups#!topic/android-developers/fXPfgw6AoeY

I’ve been trying combinations of requesting focus, invalidate, request layout, and so on with no success. I’m hoping someone here can help me see the light!

  • 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-04T03:50:36+00:00Added an answer on June 4, 2026 at 3:50 am

    Answering my own question: FIXED! The problem appears to be having an invisible VideoView overlaying my GLSurfaceView in the layout xml. Removing the VideoView from the layout restores the expected behavior.

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

Sidebar

Related Questions

Edit: I fixed the problem by just starting from scratch. Sorry to waste y'alls
Edit : The bug that caused this problem has been fixed. The @version tag
Edit: Creating a new module in the same VSMacros project fixed the problem. The
I am having a problem in Chrome when I slideToggle() and element. EDIT: Example
I'm trying to build a layout for a blog-like application having: a fixed-position fixed-width
EDIT: Problem was fixed in .NET 4.0. I have been trying to bind a
EDIT: Fixed most of the problem (but not too sure why). Check the bottom
Edit: closing anchor fixed. This issue exists when testing on the following browsers: Google
EDIT: I have fixed all but two warnings now, so thank you all for
EDIT : As of 2012-06-11 this bug has been finally fixed! https://bugs.webkit.org/show_bug.cgi?id=35981#c1 I have

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.