NullPointerException when using RelativeLayout as custom InfoWindow

前端 未结 3 2037
自闭症患者
自闭症患者 2020-12-23 21:51

I\'m trying to use a RelativeLayout as custom InfoWindow for my markers, but a I get a NullPointerException every time showInfoW

3条回答
  •  孤独总比滥情好
    2020-12-23 22:32

    I experienced this issue even when I didn't have a RelativeLayout in my xml. It turns out that my class backing the XML inherited from RelativeLayout, even though it was a LinearLayout.

    It didn't cause a bug for several different devices, but when I tried on my S3 it crashed.

    Anyways, just either remove or wrap the RelativeLayout or set a layout height/width first.

提交回复
热议问题