Dim ctxt As JavaObject
ctxt.InitializeContext
Dim JO As JavaObject = ctxt.RunMethodJO("getWindow", Null)
JO = JO.RunMethodJO("getDecorView", Null)
JO = JO.RunMethodJO("getRootWindowInsets",Null)
JO = JO.RunMethodJO("getDisplayCutout",Null)
If JO.IsInitialized Then
Log("Device has a notch")
JO = JO.RunMethodJO("getSafeInsetTop",Null)
Log("Notch Height: " & JO)
End If
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim JO As JavaObject = ctxt.RunMethodJO("getWindow", Null)
JO = JO.RunMethodJO("getDecorView", Null)
JO = JO.RunMethodJO("getRootWindowInsets",Null)
JO = JO.RunMethodJO("getDisplayCutout",Null)
If JO.IsInitialized Then
Log("Device has a notch")
JO = JO.RunMethodJO("getSafeInsetTop",Null)
Log("Notch Height: " & JO)
End If
Note that this method is only available on Android 8+. The code is correct. If it is not initialized then the device doesn't have a notch or doesn't support this feature properly.