I have a TextureView in my code on which I set the SurfaceTextureListener .
On Android 6.0, the onSurfaceTextureDestroyed and onSurfaceTextureAvailable are called whenever I leave the activity and return (respectively), while on Android 7.0 I notice that onSurfaceTextureAvailable is called only once after the Activity is created.
The surface is not destroyed and is recreated whenever I leave activity and return, as I'm used to Android 6.0.
After some investigation, I noticed that APIs 18,19,24 behave in one direction and APIs 20-23 behave in a different way.
Any idea why and basically how to make it behave the same on all versions of Android?
android android-7.0-nougat textureview
Hadas kaminsky
source share