我得到一个 NullPointerException 正在破坏这一行的代码:
if (options.isVisible()) {
这是代码块:
protected static GoogleMap map;
protected static MarkerOptions markerOptions;
private OnMarkerCreateListener listener;
public LazyMarker(GoogleMap map, MarkerOptions options) {
this(map, options, null);
}
public LazyMarker(GoogleMap map, MarkerOptions options, OnMarkerCreateListener listener) {
if (options.isVisible()) {
createMarker(map, options, listener);
} else {
this.map = map;
this.markerOptions = copy(options);
this.listener = listener;
}
}
我猜它与 MarkerOptions 变量有关,但我不确定它是否因为没有被初始化而中断?任何帮助将不胜感激。