Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. // Bind to LocalService
  2. Intent intent = new Intent(Dashboard.this, GPSService.class);
  3. bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
  4. mHandler = new Handler() {
  5. @Override
  6. public void handleMessage(Message msg) {
  7. try{
  8. if (mService.StartadressFlag==1){
  9. doUpdate(); //This updates the TextViews with values from service
  10. callMap(); //This calls the map with LAT and LONG from service
  11. }
  12. mHandler.sendEmptyMessageDelayed(MSG_UPDATE, UPDATE_RATE_IN_MS);
  13. }
  14. catch(final Exception ex){
  15. //damn
  16. Log.e("Dashboard", "Error in activity", ex); // log the error
  17. }
  18.  
  19. }
  20. };
  21. MapView mapView = (MapView) findViewById(R.id.mapview);
  22. mapView.setBuiltInZoomControls(true);
  23. mapView = (MapView) findViewById(R.id.mapview);
  24. // enable Street view by default
  25. mapView.setStreetView(true);
  26. // enable to show Satellite view
  27. // mapView.setSatellite(true);
  28. // enable to show Traffic on map
  29. // mapView.setTraffic(true);
  30. mapView.setBuiltInZoomControls(true);
  31. mapController = mapView.getController();
  32. mapController.setZoom(16);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement