Hi, just came across this thread http://www.mail-archive.com/android-developers@googlegroups.com/msg63994.html. Hope this might help you.
Also, does the use of android.os.PowerManager.WakeLock class feasible for your apps? On Nov 27, 3:47 am, David Given <d...@cowlark.com> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Is there any way where I can detect that the screen is about to turn > off, so I can do some work *before* it happens? > > I need this to work around bug 3755: OpenGL apps sometimes crash when > the screen gets turned off because they don't get > surfaceDestroyed()/surfaceCreated() events. > > http://code.google.com/p/android/issues/detail?id=3755 > > Simply put, I need to shut down OpenGL before the phone has a chance to > detach the GPU. The only events I seems to be getting when the screen > turns off are onPause() and onWindowFocusChanged()... both of which turn > up *after* the GPU detaches, by which time it's too late. > > Can anyone suggest any way of doing this? > > (In desperation, I have tried to intercept the power key, but the > power/hangup key is treated specially and doesn't generate keyboard > events...) > > - -- > ┌─── dg@cowlark.com ─────http://www.cowlark.com───── > │ > │ "Sufficiently advanced incompetence is indistinguishable from > │ malice." -- Vernon Schryver > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org > > iEYEARECAAYFAksPvFIACgkQf9E0noFvlzioGACfW5r72xNXqykHvSu4SocKo0bw > rlkAoLNa6NZiWgczIBHtLmgJmzFZLiaR > =HOwY > -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en