Android Question distinguish if device has a notch or not?

Discussion in 'Android Questions' started by Gunther, Feb 26, 2019.

  1. Gunther

    Gunther Active Member Licensed User

  2. Brandsum

    Brandsum Well-Known Member Licensed User

    Dim ctxt As JavaObject

    Dim JO As JavaObject = ctxt.RunMethodJO("getWindow"Null)
    JO = JO.RunMethodJO(
    JO = JO.RunMethodJO(
    JO = JO.RunMethodJO(

    If JO.IsInitialized Then
    Log("Device has a notch")
        JO = JO.RunMethodJO(
    Log("Notch Height: " & JO)
    End If
    Check this documentation for more details:
  3. capisx

    capisx Member Licensed User

    I've tried this code but the "JO" always return 'Not initialized', tested both in emulator and phone with notch.
  4. Erel

    Erel Administrator Staff Member Licensed User

    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.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice