android - Why marker's info window doesn't show? -


i stuck couldn't figour out why info window doesn't show when click on map's marker. read on developer android site should add marker , give them title, snippet , on. result nothing.

public class clubmapactivity extends defaultactivity implements googlemap.onmarkerclicklistener {     private googlemap mmap;     public void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.clubmap);         bundle bundle = getintent().getextras();         double lat = bundle.getdouble("latitude");         double lng = bundle.getdouble("longitude");           mmap = ((mapfragment) getfragmentmanager().findfragmentbyid(r.id.map)).getmap();         mmap.addmarker(new markeroptions()                 .position(new latlng(lat, lng))                 .title(bundle.getstring("clubnmae")).snippet("aaa"));          animatecamerato(lat, lng);         cameraupdate zoom=cameraupdatefactory.zoomto(20);          mmap.animatecamera(zoom);       }      public void animatecamerato(final double lat, final double lng)     {         cameraupdate center=                 cameraupdatefactory.newlatlng(new latlng(lat, lng));         cameraupdate zoom=cameraupdatefactory.zoomto(18);          mmap.movecamera(center);         mmap.animatecamera(zoom);     }       @override     public boolean onmarkerclick(marker marker) {         if(marker.isinfowindowshown()) {             marker.hideinfowindow();         } else {             marker.showinfowindow();         }         return true;     } } 

by default, info window displayed when user taps on marker if marker has title set.

make sure .title(bundle.getstring("clubnmae") returning not null value otherwise cannot see info window when clicking on marker.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -