Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ACCESS_FINE_LOCATION
- locationmanager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);
- locationmanager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,0,0,googlemapactivity.this);
- @Override
- public void onLocationChanged(Location location)
- {
- tcurrentlocation.setText(location.getLatitude()+","+location.getLongitude());
- locationmanager.removeUpdates(this);
- LatLng currentlocation=new LatLng(location.getLatitude(),location.getLongitude());
- map.addMarker(new MarkerOptions().position(currentlocation).title("Current Location"));
- map.moveCamera(CameraUpdateFactory.newLatLng(currentlocation));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement