0

KitKat version destroys GLSurfaceView when mediaplayer containing glsurfaceview is gone to background

Description:

I have a sample app with mediaplayer containing glsurfaceview plays local video.If user goes to device settings page and come back to app, android system destroys glsurfaceview.(onsurfacetexturedestroyed is getting called)

Please suggest me some ideas how to prevent android from deleting glsurfaceview when app resumes from background

Thanks Srini

fadden
  • 51,356
  • 5
  • 116
  • 166
Srini
  • 41
  • 3
  • You can't prevent GLSurfaceView from tearing itself down when the activity pauses. I think this is more of a MediaPlayer question. (tags updated) – fadden Apr 25 '14 at 15:02
  • @ fadden Thanks for your reply. But i would like to mention that it is not true in all cases.When ever we call glsurfaceview pause in activity onpause only glsurfaceview will be destroyed before kitkat versions. But with kitkat versions when ever activity goes to onpause itself surface is getting destroyed – Srini Apr 28 '14 at 08:52
  • http://stackoverflow.com/questions/21567641/21684399#21684399 has some notes about the SurfaceView lifecycle. If the device goes through a software-forced orientation change (e.g. the lock screen insists on being portrait, but the device is in landscape), you'll lose the Surface. The behavior is not something you can control... you have to be prepared for the Surface to disappear when the app is paused (and also prepared for it *not* to disappear). – fadden Apr 28 '14 at 17:59

0 Answers0