I have a TextureView
in my code to which I've set a SurfaceTextureListener
.
On Android 6.0 the methods onSurfaceTextureDestroyed
and onSurfaceTextureAvailable
are called whenever I leave the activity and return (respectively) while on Android 7.0 I notice that onSurfaceTextureAvailable
is only called once after the Activity is created.
The surface is not destroyed and recreated whenever I leave the activity and return like I'm used to from Android 6.0.
After some investigation I notice that API 18,19,24 behave one way and API 20-23 behave the other way.
Any idea why, and mainly how to make it behave the same on all Android versions?