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.