google maps - Android Update Current Location -


so here method getting user saved location , move camera location:

     private void updateplaces(){      locman = (locationmanager)getsystemservice(context.location_service);     location lastloc = locman.getlastknownlocation(locationmanager.network_provider);      double lat = lastloc.getlatitude();     double lng = lastloc.getlongitude();      latlng lastlatlng = new latlng(lat, lng);      if(usermarker!=null) usermarker.remove();      usermarker = themap.addmarker(new markeroptions()     .position(lastlatlng)     .title("you here")     .icon(bitmapdescriptorfactory.fromresource(usericon))     .snippet("your last recorded location"));     themap.animatecamera(cameraupdatefactory.newlatlng(lastlatlng), 3000, null);     } 

how can modify code in order new position once, compare , camera it?

thank in advance.

i don't understand question, if run method updateplaces() ones getlastknownlocation once , updates user marker once. please more explanatory on trying achieve?


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -