Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Bind to LocalService
- Intent intent = new Intent(Dashboard.this, GPSService.class);
- bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
- mHandler = new Handler() {
- @Override
- public void handleMessage(Message msg) {
- try{
- if (mService.StartadressFlag==1){
- doUpdate(); //This updates the TextViews with values from service
- callMap(); //This calls the map with LAT and LONG from service
- }
- mHandler.sendEmptyMessageDelayed(MSG_UPDATE, UPDATE_RATE_IN_MS);
- }
- catch(final Exception ex){
- //damn
- Log.e("Dashboard", "Error in activity", ex); // log the error
- }
- }
- };
- MapView mapView = (MapView) findViewById(R.id.mapview);
- mapView.setBuiltInZoomControls(true);
- mapView = (MapView) findViewById(R.id.mapview);
- // enable Street view by default
- mapView.setStreetView(true);
- // enable to show Satellite view
- // mapView.setSatellite(true);
- // enable to show Traffic on map
- // mapView.setTraffic(true);
- mapView.setBuiltInZoomControls(true);
- mapController = mapView.getController();
- mapController.setZoom(16);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement