Received: by 10.52.68.147 with SMTP id w19mr2605254vdt.7.1315384305318; Wed, 07 Sep 2011 01:31:45 -0700 (PDT) X-BeenThere: android-developers@googlegroups.com Received: by 10.220.205.91 with SMTP id fp27ls2287688vcb.0.gmail; Wed, 07 Sep 2011 01:30:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.185.67 with SMTP id cn3mr1041952vcb.17.1315384228633; Wed, 07 Sep 2011 01:30:28 -0700 (PDT) Received: by et6g2000vbb.googlegroups.com with HTTP; Wed, 7 Sep 2011 01:30:28 -0700 (PDT) Date: Wed, 7 Sep 2011 01:30:28 -0700 (PDT) In-Reply-To: References: <0b2e4f81-437b-489c-9144-558587e341f0@t3g2000vbe.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.2; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1,gzip(gfe) Message-ID: Subject: Re: Black screen after switching to another app From: MarcoAndroid To: Android Developers Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Are you sure you know which code gets executed? I'd add breakpoints/ logging statements to see what's happening... At least a logstatement on all onStart(), onResume() onXYZ() methods entry points. Maybe then you get a better idea on what's going on. On 6 sep, 18:58, MobileVisuals wrote: > 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() { > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 super.onPause(); > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!menu2d) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 glSurfaceView.onPause(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mLunarView.getThread().su= spend(); > > =A0 =A0 =A0 =A0 } > protected void onResume() { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 super.onResume(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!menu2d) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 glSurfaceView.onResume(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mLunarView.getThread().re= sume(); > > =A0 =A0 =A0 =A0 } > > On Sep 6, 2:43=A0pm, Daniel Drozdzewski > wrote: > > > > > > > > > On 6 September 2011 13:32, MobileVisuals wro= te: > > > > My app has a SurfaceView and a GLSurfaceView. =A0I can switch back an= d > > > 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 onl= y > > > black. I have tried almost everything to fix this, I have checked tha= t > > > the thread is running and that no instance of any object (like the > > > SurfaceHolder) is null. What could be the reason for this black scree= n? > > > 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 > > > --