Clear screen on wake?

9 views
Skip to first unread message

Josh Gooderham

unread,
Dec 7, 2011, 8:15:47 PM12/7/11
to glwallpap...@googlegroups.com
I have had a few instances where I would have preferred to have a blank screen to come back to after a device wake. For instance if I wanted to reset the scene completely between sleeps, I don't want the old scene to be visible, even for a frame. Looks sloppy. As far as I can tell this isn't really possible. It seems that you just don't have access to both screen buffers in GLWallpaperService. Is there some way we could tell the system to flush the front and back buffers on onPause?

Josh
https://market.android.com/developer?pub=gentlemandroid
http://www.gentlemandroid.com/

U A

unread,
Dec 10, 2011, 11:40:45 AM12/10/11
to GLWallpaperService
Yeah, i also noticed that too. Anyone?

A workaround is to call a run queue at the start of onDrawFrame(). Put
the code to reset the screen in a Runnable, then pass it to the run
queue. If you look at the existing GLWallpaperService code, that's
what queueEvent() does---except that it runs the queue after drawing.
This way guarantees that your code gets called before drawing. At
least that's what I've been observing in my test phone...

Reply all
Reply to author
Forward
0 new messages