2

If my NDK based app is running, and I swipe up from bottom, to get the Task Switcher, my Native Window is destroyed.

Is this normal behaviour? I see this on Android9, and I could have sworn that going to the task switcher in older Android OS versions would not destroy the window?

So bringing up the task switcher causes onNativeWindowDestroyed() being triggered, which leads to a APP_CMD_TERM_WINDOW to be posted and handled by my app by destroying all its OpenGL resources.

It seems wasteful to completely destroy everything, and rebuild everything, merely because the user brought up the task switcher, even if the same task is foregrounded again?

Is this according to spec? Can it be avoided?

My app uses android_native_app_glue.c and properly implements the Android app life-cycle.

enter image description here

Bram
  • 7,440
  • 3
  • 52
  • 94
  • This is an implementation detail, might not reproduce on a different device with Android 9. You don't need to destroy all GL resources, whatever you can reuse on a new native window, can stay. – Alex Cohn Oct 12 '19 at 08:17
  • 1
    For me, same behavior happens on API 21 (Android 5.0.2). – Alex Cohn Oct 12 '19 at 20:46

0 Answers0