第一次单击时不会打开Goog​​le地图信息窗口,而是在第二次单击时显示(ANDROID JAVA)

时间:2019-03-17 19:36:08

标签: java android google-maps picasso

我正在使用以下代码在地图中打开一个信息窗口:

//定义弹出窗口

private View popup = null;

mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter(){
    @Override
    public View getInfoWindow(Marker marker) {
        return null;
    }
    @Override
    public View getInfoContents(final Marker marker) {
        if(popup == null){
            popup = getLayoutInflater().inflate(R.layout.custom_adress,null);
        }
        final ImageView customadresimage = (ImageView) popup.findViewById(R.id.customadresimage); //my imageview       
        Picasso.get().load(marker.getSnippet()).resize(200,200).into(customadresimage); //save and show photo from firebase  
        return popup;
    }
});

当我单击图钉时,首先不显示照片,而当我单击图钉时,显示照片。

  1. 首次点击 enter image description here
  2. 第二次点击: enter image description here 怎么了 ?

0 个答案:

没有答案