https://kotlinlang.org logo
#android
Title
# android
w

Willy Njundong

05/29/2019, 6:59 AM
I can't quite understand what this syntax is:
Copy code
private val surfaceTextureListener = object : TextureView.SurfaceTextureListener {

        override fun onSurfaceTextureAvailable(texture: SurfaceTexture, width: Int, height: Int) {
        //...
    }
g

gildor

05/29/2019, 7:00 AM
It’s creation of object
like creation of anonymous class in Java
w

Willy Njundong

05/29/2019, 7:00 AM
Aw man, I never got that far with Java. Only basic classes.
g

gildor

05/29/2019, 7:00 AM
Java analogue would be:
Copy code
new TextureView.SurfaceTextureListener {
   @Override
   void  onSurfaceTextureAvailable(…)
}
w

Willy Njundong

05/29/2019, 7:00 AM
Can you link me to relevant kotlin docs that might give me more insight
w

Willy Njundong

05/29/2019, 7:01 AM
Wonderful thank you for your help sir
2 Views