I\'m trying to use a RelativeLayout
as custom InfoWindow
for my markers, but a I get a NullPointerException
every time showInfoW
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.
I had this problem and was able to fix it by adding
view.setLayoutParams(new ViewGroup.LayoutParams(desiredWidth,desiredHeight));
to the view before returning it from InfoWindowAdapter.getInfoWindow
Just found out that in android version < 4.4 this generates a nullpointer exception. Changing the layout with a Linear one will solve the problem.