Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update google map v2 location from background service android

I have a background service that implements LocationListener and will provide Location updates periodically. I want to then use those location updates to update the user position on a map in the main activity. I'm able to pass the latitude longitude data via an intent to the main activity, but I don't know how to use that data to display the user's location.

like image 486
user2166312 Avatar asked Mar 13 '13 16:03

user2166312


1 Answers

Check out this link:

https://developers.google.com/maps/documentation/android/

Specifically these lines

LatLng sydney = new LatLng(-33.867, 151.206);

map.setMyLocationEnabled(true);
map.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 13));
like image 159
gyoda Avatar answered Nov 08 '22 03:11

gyoda