Thanks, I added this code to the app, but the problem remains. I don't
know if I should use suspend and resume on the GUI thread, because the
documentation says that it could cause deadlocks.Do you know if there
is some more that I can do to solve this issue?

protected void onPause() {

                super.onPause();

                if (!menu2d)
                        glSurfaceView.onPause();
                else
                        mLunarView.getThread().suspend();

        }
protected void onResume() {
                super.onResume();
                if (!menu2d)
                        glSurfaceView.onResume();
                else
                        mLunarView.getThread().resume();

        }

On Sep 6, 2:43 pm, Daniel Drozdzewski <[email protected]>
wrote:
> On 6 September 2011 13:32, MobileVisuals <[email protected]> wrote:
>
> > My app has a SurfaceView and a GLSurfaceView.  I can switch back and
> > forth between these. The SurfaceView is the application GUI.
>
> > I test switching to another app. I can then switch back to the
> > GLSurfaceView in my app. I then try to switch back to the
> > GLSurfaceView,where the application GUI is. Here is where the problem
> > occurs. A black screen is shown instead of the GUI.
>
> > The app still works, because the application menu is shown when the
> > menu button is pressed. But nothing is drawn on the screen, it is only
> > black. I have tried almost everything to fix this, I have checked that
> > the thread is running and that no instance of any object (like the
> > SurfaceHolder) is null. What could be the reason for this black screen?
>
> Do you call GLSurfaceView.resume() from Activity.resume() ?
>
> By the same token you should be calling GLSurfaceView.pause() in the
> right moment of your activity lifecycle.
>
> HTH
>
> --
> Daniel Drozdzewski

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to