List of usage examples for android.location Location setBearing
public void setBearing(float bearing)
From source file:Main.java
public static Location readLocation(Parcel in) { Location loc = new Location(in.readString()); loc.setTime(in.readLong());/*ww w . j a v a 2 s. c om*/ loc.setLatitude(in.readDouble()); loc.setLongitude(in.readDouble()); loc.setAltitude(in.readDouble()); loc.setAccuracy(in.readFloat()); loc.setBearing(in.readFloat()); loc.setSpeed(in.readFloat()); return loc; }
From source file:com.keithcassidy.finishline.LineCrossHandler.java
private void HandleLineCrossing(Location location) { //does this location and bearing intersect with finish line DistanceIntersection diToFinish = LocationUtils.distanceToFinish(location, buoy1, buoy2, finishLineExtension);//from w w w . j a va 2s . c o m sendLocalBroadcast(Constants.FINISHLINE_DISTANCE_MESSAGE, diToFinish.distance); if (isRacing) { //sound appropriate to distance startBeepTimer(PlaySounds.getPeriodFromDistance((int) diToFinish.distance)); //update latest time (used for deciding if service should restart after a crash/reboot PreferencesUtils.setLastRaceStopTime(context, location.getTime()); if (lastLocation != null && lastLocation.distanceTo(location) > LocationUtils.EPSILON) { Log.d(TAG, "last location time " + lastLocation.getTime()); Location locationLookingBack = new Location(location); locationLookingBack.setBearing(locationLookingBack.bearingTo(lastLocation)); DistanceIntersection diBackToFinish = LocationUtils.distanceToFinish(locationLookingBack, buoy1, buoy2, finishLineExtension); if (!Double.isInfinite(diBackToFinish.distance) && diBackToFinish.distance >= 0 && diBackToFinish.intersection != null && (location .distanceTo(diBackToFinish.intersection) <= location.distanceTo(lastLocation))) { long timeOfCrossing = lastLocation.getTime() + (long) ((location.getTime() - lastLocation.getTime()) * (lastLocation.distanceTo(diBackToFinish.intersection) / location.distanceTo(lastLocation))); diBackToFinish.intersection.setTime(timeOfCrossing); diBackToFinish.intersection.setBearing(lastLocation.bearingTo(location)); finishLineDataStorage.addCrossing(diBackToFinish.intersection); sendLocalBroadcast(Constants.FINISHLINE_CROSSED_MESSAGE, true); PlaySounds.playLineCross(context); } } lastLocation = location; } //lastDistanceToFinish = diToFinish.distance; /* if (lastLocation != null && isRacing) { //test to see if we crossed the line if( !Double.isInfinite(lastDistanceToFinish) && lastDistanceToFinish > 0 && diToFinish.distance <= 0 ) { long timeOfCrossing = lastLocation.getTime() + (long)((location.getTime() - lastLocation.getTime()) * (lastDistanceToFinish / (Math.abs(diToFinish.distance) + lastDistanceToFinish)) ) ; Location buoyStart = new Location("na"); buoyStart.setLatitude(buoy1.Position.latitude); buoyStart.setLongitude(buoy1.Position.longitude); Location buoyEnd = new Location("na"); buoyEnd.setLatitude(buoy2.Position.latitude); buoyEnd.setLongitude(buoy2.Position.longitude); buoyEnd.setBearing(buoyEnd.bearingTo(buoyStart)); buoyStart.setBearing(buoyStart.bearingTo(buoyEnd)); //Location locationCrossing = LocationUtils.intersectionOfTwoPaths(lastLocation, buoyStart); if( diToFinish.intersection != null ) { diToFinish.intersection.setTime(timeOfCrossing); diToFinish.intersection.setBearing(lastLocation.getBearing()); finishLineDataStorage.addCrossing(diToFinish.intersection); sendLocalBroadcast(Constants.FINISHLINE_CROSSED_MESSAGE, true); PlaySounds.playLineCross(context); } } } */ }
From source file:to.sven.androidrccar.common.communication.model.LocationMessage.java
/** * Converts the Location Message to {@link Location}. * @return An {@link Location} with the information of this Message. *//* ww w .ja v a2 s. c o m*/ public Location toAndroidLocation() { Location location = new Location((String) null); location.setLatitude(latitude); location.setLongitude(longitude); if (hasAltitude) { location.setAltitude(altitude); } if (hasAccuracy) { location.setAccuracy(accuracy); } if (hasBearing) { location.setBearing(bearing); } if (hasSpeed) { location.setSpeed(speed); } return location; }
From source file:com.kevinquan.android.location.SimpleRecordedLocation.java
public Location asLocation() { Location location = new Location(TAG); location.setLatitude(mLatitude);/*from w w w .j av a 2s . c om*/ location.setLongitude(mLongitude); location.setAccuracy(mAccuracy); location.setAltitude(mAltitude); location.setBearing(mBearing); location.setSpeed(mSpeed); location.setTime(mRecordedAt); return location; }
From source file:dtu.ds.warnme.app.location.FollowMeLocationSource.java
@Override public void onLocationChanged(Location location) { Log.i(TAG, "Location changed: " + location); if (!location.hasBearing()) { Log.w(TAG, "Location does not have bearing. Will calculate on our own..."); if (previousLocation != null) { float bearing = previousLocation.bearingTo(location); location.setBearing(bearing); Log.w(TAG, "New bearing: " + bearing); }// www.ja v a 2s. c o m previousLocation = location; } if (locationChangedListener != null) { locationChangedListener.onLocationChanged(location); } CameraPosition cameraPosition = new CameraPosition.Builder() .target(new LatLng(location.getLatitude(), location.getLongitude())).zoom(17) .bearing(location.getBearing()).tilt(40).build(); map.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); lastKnownLocation = location; pullNewEvents(location); checkEventsProximity(location); }
From source file:com.zoffcc.applications.zanavi.Navit.java
@SuppressLint("NewApi") public boolean onOptionsItemSelected_wrapper(int id) { // Handle item selection switch (id) { case 1:// w w w .j a v a 2 s. c o m // zoom in Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 1); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); // if we zoom, hide the bubble if (N_NavitGraphics.NavitAOverlay != null) { N_NavitGraphics.NavitAOverlay.hide_bubble(); } Log.e("Navit", "onOptionsItemSelected -> zoom in"); break; case 2: // zoom out msg = new Message(); b = new Bundle(); b.putInt("Callback", 2); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); // if we zoom, hide the bubble if (N_NavitGraphics.NavitAOverlay != null) { N_NavitGraphics.NavitAOverlay.hide_bubble(); } Log.e("Navit", "onOptionsItemSelected -> zoom out"); break; case 3: // map download menu Intent map_download_list_activity = new Intent(this, NavitDownloadSelectMapActivity.class); this.startActivityForResult(map_download_list_activity, Navit.NavitDownloaderPriSelectMap_id); break; case 5: toggle_poi_pref(); set_poi_layers(); draw_map(); break; case 6: // ok startup address search activity (online google maps search) Navit.use_index_search = false; Intent search_intent = new Intent(this, NavitAddressSearchActivity.class); search_intent.putExtra("title", Navit.get_text("Enter: City and Street")); //TRANS search_intent.putExtra("address_string", Navit_last_address_search_string); //search_intent.putExtra("hn_string", Navit_last_address_hn_string); search_intent.putExtra("type", "online"); String pm_temp = "0"; if (Navit_last_address_partial_match) { pm_temp = "1"; } search_intent.putExtra("partial_match", pm_temp); this.startActivityForResult(search_intent, NavitAddressSearch_id_online); break; case 7: // ok startup address search activity (offline binfile search) Navit.use_index_search = Navit.allow_use_index_search(); Intent search_intent2 = new Intent(this, NavitAddressSearchActivity.class); search_intent2.putExtra("title", Navit.get_text("Enter: City and Street")); //TRANS search_intent2.putExtra("address_string", Navit_last_address_search_string); search_intent2.putExtra("hn_string", Navit_last_address_hn_string); search_intent2.putExtra("type", "offline"); search_intent2.putExtra("search_country_id", Navit_last_address_search_country_id); String pm_temp2 = "0"; if (Navit_last_address_partial_match) { pm_temp2 = "1"; } search_intent2.putExtra("partial_match", pm_temp2); this.startActivityForResult(search_intent2, NavitAddressSearch_id_offline); break; case 8: // map delete menu Intent map_delete_list_activity2 = new Intent(this, NavitDeleteSelectMapActivity.class); this.startActivityForResult(map_delete_list_activity2, Navit.NavitDeleteSecSelectMap_id); break; case 9: // stop navigation (this menu should only appear when navigation is actually on!) Message msg2 = new Message(); Bundle b2 = new Bundle(); b2.putInt("Callback", 7); msg2.setData(b2); NavitGraphics.callback_handler.sendMessage(msg2); Log.e("Navit", "stop navigation"); break; case 10: // open settings menu Intent settingsActivity = new Intent(getBaseContext(), NavitPreferences.class); startActivity(settingsActivity); break; case 11: //zoom_to_route zoom_to_route(); break; case 12: // --------- make app crash --------- // --------- make app crash --------- // --------- make app crash --------- // ** // DEBUG // ** // crash_app_java(1); // ** // DEBUG // ** // crash_app_C(); // --------- make app crash --------- // --------- make app crash --------- // --------- make app crash --------- // announcer off Navit_Announcer = false; msg = new Message(); b = new Bundle(); b.putInt("Callback", 34); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); try { invalidateOptionsMenu(); } catch (Exception e) { } break; case 13: // announcer on Navit_Announcer = true; msg = new Message(); b = new Bundle(); b.putInt("Callback", 35); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); try { invalidateOptionsMenu(); } catch (Exception e) { } break; case 14: // show recent destination list Intent i2 = new Intent(this, NavitRecentDestinationActivity.class); this.startActivityForResult(i2, Navit.NavitRecentDest_id); break; case 15: // show current target on googlemaps String current_target_string = NavitGraphics.CallbackGeoCalc(4, 1, 1); // Log.e("Navit", "got target 1: "+current_target_string); if (current_target_string.equals("x:x")) { Log.e("Navit", "no target set!"); } else { try { String tmp[] = current_target_string.split(":", 2); googlemaps_show(tmp[0], tmp[1], "ZANavi Target"); } catch (Exception e) { e.printStackTrace(); Log.e("Navit", "problem with target!"); } } break; case 16: // show online manual Log.e("Navit", "user wants online help, show the website lang=" + NavitTextTranslations.main_language.toLowerCase()); // URL to ZANavi Manual (in english language) String url = "http://zanavi.cc/index.php/Manual"; if (FDBL) { url = "http://fd.zanavi.cc/manual"; } if (NavitTextTranslations.main_language.toLowerCase().equals("de")) { // show german manual url = "http://zanavi.cc/index.php/Manual/de"; if (FDBL) { url = "http://fd.zanavi.cc/manualde"; } } Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); startActivity(i); break; case 17: // show age of maps (online) Intent i3 = new Intent(Intent.ACTION_VIEW); i3.setData(Uri.parse(NavitMapDownloader.ZANAVI_MAPS_AGE_URL)); startActivity(i3); break; case 18: Intent intent_latlon = new Intent(Intent.ACTION_MAIN); //intent_latlon.setAction("android.intent.action.POINTPICK"); intent_latlon.setPackage("com.cruthu.latlongcalc1"); intent_latlon.setClassName("com.cruthu.latlongcalc1", "com.cruthu.latlongcalc1.LatLongMain"); //intent_latlon.setClassName("com.cruthu.latlongcalc1", "com.cruthu.latlongcalc1.LatLongPointPick"); try { startActivity(intent_latlon); } catch (Exception e88) { e88.printStackTrace(); // show install page try { // String urlx = "http://market.android.com/details?id=com.cruthu.latlongcalc1"; String urlx = "market://details?id=com.cruthu.latlongcalc1"; Intent ix = new Intent(Intent.ACTION_VIEW); ix.setData(Uri.parse(urlx)); startActivity(ix); } catch (Exception ex) { ex.printStackTrace(); } } break; case 19: // GeoCoordEnterDialog Intent it001 = new Intent(this, GeoCoordEnterDialog.class); this.startActivityForResult(it001, Navit.NavitGeoCoordEnter_id); break; case 20: // convert GPX file Intent intent77 = new Intent(getBaseContext(), FileDialog.class); File a = new File(p.PREF_last_selected_dir_gpxfiles); try { // convert the "/../" in the path to normal absolut dir intent77.putExtra(FileDialog.START_PATH, a.getCanonicalPath()); //can user select directories or not intent77.putExtra(FileDialog.CAN_SELECT_DIR, false); // disable the "new" button intent77.putExtra(FileDialog.SELECTION_MODE, SelectionMode.MODE_OPEN); //alternatively you can set file filter //intent.putExtra(FileDialog.FORMAT_FILTER, new String[] { "gpx" }); startActivityForResult(intent77, Navit.NavitGPXConvChooser_id); } catch (IOException e1) { e1.printStackTrace(); } break; case 21: // add traffic block (like blocked road, or construction site) at current location of crosshair try { String traffic = ""; if (Navit.GFX_OVERSPILL) { traffic = NavitGraphics.CallbackGeoCalc(7, (int) (NavitGraphics.Global_dpi_factor * (NavitGraphics.mCanvasWidth / 2 + NavitGraphics.mCanvasWidth_overspill)), (int) (NavitGraphics.Global_dpi_factor * (NavitGraphics.mCanvasHeight / 2 + NavitGraphics.mCanvasHeight_overspill))); } else { traffic = NavitGraphics.CallbackGeoCalc(7, (int) (NavitGraphics.Global_dpi_factor * NavitGraphics.mCanvasWidth / 2), (int) (NavitGraphics.Global_dpi_factor * NavitGraphics.mCanvasHeight / 2)); } // System.out.println("traffic=" + traffic); File traffic_file_dir = new File(MAP_FILENAME_PATH); traffic_file_dir.mkdirs(); File traffic_file = new File(MAP_FILENAME_PATH + "/traffic.txt"); FileOutputStream fOut = null; OutputStreamWriter osw = null; try { fOut = new FileOutputStream(traffic_file, true); osw = new OutputStreamWriter(fOut); osw.write("type=traffic_distortion maxspeed=0" + "\n"); // item header osw.write(traffic); // item coordinates osw.close(); fOut.close(); } catch (Exception ef) { ef.printStackTrace(); } // update route, if a route is set msg = new Message(); b = new Bundle(); b.putInt("Callback", 73); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); // draw map no-async msg = new Message(); b = new Bundle(); b.putInt("Callback", 64); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { e.printStackTrace(); } break; case 22: // clear all traffic blocks try { File traffic_file = new File(MAP_FILENAME_PATH + "/traffic.txt"); traffic_file.delete(); // update route, if a route is set msg = new Message(); b = new Bundle(); b.putInt("Callback", 73); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); // draw map no-async msg = new Message(); b = new Bundle(); b.putInt("Callback", 64); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } break; case 23: // clear all GPX maps try { File gpx_file = new File(MAP_FILENAME_PATH + "/gpxtracks.txt"); gpx_file.delete(); // draw map no-async msg = new Message(); b = new Bundle(); b.putInt("Callback", 64); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } break; case 24: // show feedback form Intent i4 = new Intent(this, NavitFeedbackFormActivity.class); this.startActivityForResult(i4, Navit.NavitSendFeedback_id); break; case 25: // share the current destination with your friends String current_target_string2 = NavitGraphics.CallbackGeoCalc(4, 1, 1); if (current_target_string2.equals("x:x")) { Log.e("Navit", "no target set!"); } else { try { String tmp[] = current_target_string2.split(":", 2); if (Navit.OSD_route_001.arriving_time_valid) { share_location(tmp[0], tmp[1], Navit.get_text("Meeting Point"), Navit.get_text("Meeting Point"), Navit.OSD_route_001.arriving_time, true); } else { share_location(tmp[0], tmp[1], Navit.get_text("Meeting Point"), Navit.get_text("Meeting Point"), "", true); } } catch (Exception e) { e.printStackTrace(); Log.e("Navit", "problem with target!"); } } break; case 26: // donate Log.e("Navit", "start donate app"); donate(); break; case 27: // donate Log.e("Navit", "donate bitcoins"); donate_bitcoins(); break; case 28: // replay GPS file Intent intent771 = new Intent(getBaseContext(), FileDialog.class); File a1 = new File(Navit.NAVIT_DATA_DEBUG_DIR); try { // convert the "/../" in the path to normal absolut dir intent771.putExtra(FileDialog.START_PATH, a1.getCanonicalPath()); //can user select directories or not intent771.putExtra(FileDialog.CAN_SELECT_DIR, false); // disable the "new" button intent771.putExtra(FileDialog.SELECTION_MODE, SelectionMode.MODE_OPEN); //alternatively you can set file filter intent771.putExtra(FileDialog.FORMAT_FILTER, new String[] { "txt", "yaml" }); startActivityForResult(intent771, Navit.NavitReplayFileConvChooser_id); } catch (IOException e1) { e1.printStackTrace(); } break; case 29: // About Screen Intent it002 = new Intent(this, ZANaviAboutPage.class); this.startActivityForResult(it002, Navit.ZANaviAbout_id); break; case 88: // dummy entry, just to make "breaks" in the menu break; case 601: // DEBUG: activate demo vehicle and set position to position to screen center Navit.DemoVehicle = true; msg = new Message(); b = new Bundle(); b.putInt("Callback", 101); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); final Thread demo_v_001 = new Thread() { @Override public void run() { try { Thread.sleep(1000); // wait 1 seconds before we start try { float lat = 0; float lon = 0; String lat_lon = ""; if (Navit.GFX_OVERSPILL) { lat_lon = NavitGraphics.CallbackGeoCalc(1, NavitGraphics.Global_dpi_factor * (NG__map_main.view.getWidth() / 2 + NavitGraphics.mCanvasWidth_overspill), NavitGraphics.Global_dpi_factor * (NG__map_main.view.getHeight() / 2 + NavitGraphics.mCanvasHeight_overspill)); } else { lat_lon = NavitGraphics.CallbackGeoCalc(1, NavitGraphics.Global_dpi_factor * NG__map_main.view.getWidth() / 2, NavitGraphics.Global_dpi_factor * NG__map_main.view.getHeight() / 2); } String tmp[] = lat_lon.split(":", 2); //System.out.println("tmp=" + lat_lon); lat = Float.parseFloat(tmp[0]); lon = Float.parseFloat(tmp[1]); //System.out.println("ret=" + lat_lon + " lat=" + lat + " lon=" + lon); Location l = null; l = new Location("ZANavi Demo 001"); l.setLatitude(lat); l.setLongitude(lon); l.setBearing(0.0f); l.setSpeed(0); l.setAccuracy(4.0f); // accuracy 4 meters // NavitVehicle.update_compass_heading(0.0f); NavitVehicle.set_mock_location__fast(l); } catch (Exception e) { } Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 52); b.putString("s", "45"); // speed in km/h of Demo-Vehicle // b.putString("s", "20"); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } }; demo_v_001.start(); msg = new Message(); b = new Bundle(); b.putInt("Callback", 51); if (Navit.GFX_OVERSPILL) { b.putInt("x", (int) (NavitGraphics.Global_dpi_factor * ((Navit.NG__map_main.view.getWidth() / 2) + NavitGraphics.mCanvasWidth_overspill))); b.putInt("y", (int) (NavitGraphics.Global_dpi_factor * ((Navit.NG__map_main.view.getHeight() / 2) + NavitGraphics.mCanvasHeight_overspill))); } else { b.putInt("x", (int) (NavitGraphics.Global_dpi_factor * Navit.NG__map_main.view.getWidth() / 2)); b.putInt("y", (int) (NavitGraphics.Global_dpi_factor * Navit.NG__map_main.view.getHeight() / 2)); } msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); break; case 602: // DEBUG: toggle textview with spoken and translated string (to help with translation) try { if (NavitGraphics.NavitMsgTv2_.getVisibility() == View.VISIBLE) { NavitGraphics.NavitMsgTv2_.setVisibility(View.GONE); NavitGraphics.NavitMsgTv2_.setEnabled(false); NavitGraphics.NavitMsgTv2sc_.setVisibility(View.GONE); NavitGraphics.NavitMsgTv2sc_.setEnabled(false); } else { NavitGraphics.NavitMsgTv2sc_.setVisibility(View.VISIBLE); NavitGraphics.NavitMsgTv2sc_.setEnabled(true); NavitGraphics.NavitMsgTv2_.setVisibility(View.VISIBLE); NavitGraphics.NavitMsgTv2_.setEnabled(true); } } catch (Exception e) { e.printStackTrace(); } break; case 603: // DEBUG: show all possible navigation commands (also translated) NavitGraphics.generate_all_speech_commands(); break; case 604: // DEBUG: activate FAST driving demo vehicle and set position to screen center Navit.DemoVehicle = true; msg = new Message(); b = new Bundle(); b.putInt("Callback", 52); b.putString("s", "800"); // speed in ~km/h of Demo-Vehicle msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); msg = new Message(); b = new Bundle(); b.putInt("Callback", 51); if (Navit.GFX_OVERSPILL) { b.putInt("x", (int) (NavitGraphics.Global_dpi_factor * ((Navit.NG__map_main.view.getWidth() / 2) + NavitGraphics.mCanvasWidth_overspill))); b.putInt("y", (int) (NavitGraphics.Global_dpi_factor * ((Navit.NG__map_main.view.getHeight() / 2) + NavitGraphics.mCanvasHeight_overspill))); } else { b.putInt("x", (int) (NavitGraphics.Global_dpi_factor * Navit.NG__map_main.view.getWidth() / 2)); b.putInt("y", (int) (NavitGraphics.Global_dpi_factor * Navit.NG__map_main.view.getHeight() / 2)); } msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); try { float lat = 0; float lon = 0; lat = 0; lon = 0; String lat_lon = ""; if (Navit.GFX_OVERSPILL) { lat_lon = NavitGraphics.CallbackGeoCalc(1, NavitGraphics.Global_dpi_factor * (NG__map_main.view.getWidth() / 2 + NavitGraphics.mCanvasWidth_overspill), NavitGraphics.Global_dpi_factor * (NG__map_main.view.getHeight() / 2 + NavitGraphics.mCanvasHeight_overspill)); } else { lat_lon = NavitGraphics.CallbackGeoCalc(1, NavitGraphics.Global_dpi_factor * NG__map_main.view.getWidth() / 2, NavitGraphics.Global_dpi_factor * NG__map_main.view.getHeight() / 2); } String tmp[] = lat_lon.split(":", 2); //System.out.println("tmp=" + lat_lon); lat = Float.parseFloat(tmp[0]); lon = Float.parseFloat(tmp[1]); //System.out.println("ret=" + lat_lon + " lat=" + lat + " lon=" + lon); Location l = null; l = new Location("ZANavi Demo 001"); l.setLatitude(lat); l.setLongitude(lon); l.setBearing(0.0f); l.setSpeed(0); l.setAccuracy(4.0f); // accuracy 4 meters // NavitVehicle.update_compass_heading(0.0f); NavitVehicle.set_mock_location__fast(l); } catch (Exception e) { } break; case 605: // DEBUG: toggle Routgraph on/off msg = new Message(); b = new Bundle(); b.putInt("Callback", 71); Navit.Routgraph_enabled = 1 - Navit.Routgraph_enabled; b.putString("s", "" + Navit.Routgraph_enabled); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); break; case 606: // DEBUG: spill contents of index file(s) msg = new Message(); b = new Bundle(); b.putInt("Callback", 83); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); break; case 607: export_map_points_to_sdcard(); break; case 608: import_map_points_from_sdcard(); break; case 609: // run yaml tests new Thread() { public void run() { try { ZANaviDebugReceiver.DR_run_all_yaml_tests(); } catch (Exception e) { } } }.start(); break; case 99: try { if (wl_navigating != null) { //if (wl_navigating.isHeld()) //{ wl_navigating.release(); Log.e("Navit", "WakeLock Nav: release 1"); //} } } catch (Exception e) { e.printStackTrace(); } // exit this.onPause(); this.onStop(); this.exit(); //msg = new Message(); //b = new Bundle(); //b.putInt("Callback", 5); //b.putString("cmd", "quit();"); //msg.setData(b); //N_NavitGraphics.callback_handler.sendMessage(msg); break; } return true; }