@Override public void onCreateContextMenu( final ContextMenu aMenu, final View aView, final ContextMenuInfo someMenuInfo) { super.onCreateContextMenu(aMenu, aView, someMenuInfo); final MenuInflater ourInflater = getMenuInflater(); ourInflater.inflate(R.menu.bookmark_context, aMenu); aMenu.setHeaderTitle(TheApp.getResString(R.string.context_title_generic)); }
protected void startLocationSearch() { if (lastLocationUpdate < (System.currentTimeMillis() - (TheApp.getPredictionRefreshDelay() / 2))) { if (theFinder.startLocationSearch()) { if (theProgressDialog != null) { theProgressDialog.dismiss(); } theProgressDialog = new ProgressDialog(this); theProgressDialog.setCancelable(true); theProgressDialog.setMessage(TheApp.getResString(R.string.loading_location)); theProgressDialog.setIndeterminate(true); theProgressDialog.show(); } } else { Collections.sort(theAdapter.getBookmarks(), new BookmarkByDistanceComparator(theLocation)); theAdapter.setTheLocation(theLocation); } }
private void setupRefreshPredictionTimer() { final boolean wantRefresh = TheApp.getPrefs() .getBoolean( TheApp.getResString(R.string.pref_auto_refresh_key), TheApp.getResBool(R.bool.pref_auto_refresh_default)); if (wantRefresh) { Log.i(LOG_NAME, "Setting up refresh predictions timer"); theRefreshPredictionTimer = new Timer(); theRefreshPredictionTimer.schedule( new TimerTask() { @Override public void run() { runRefreshPredictionTimer(); } }, 250, TheApp.getPredictionRefreshDelay()); } }
private void setupRotateTimer() { final boolean wantRefresh = TheApp.getPrefs() .getBoolean( TheApp.getResString(R.string.pref_auto_refresh_key), TheApp.getResBool(R.bool.pref_auto_refresh_default)); if (wantRefresh) { Log.i(LOG_NAME, "We're gonna set up a timer"); theRotateTimer = new Timer(); theRotateTimer.schedule( new TimerTask() { @Override public void run() { runRotateTimer(); } }, CYCLE_PREDICTIONS_DURATION, CYCLE_PREDICTIONS_DURATION); } }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map); final Intent theIntent = getIntent(); theStop = theIntent.getParcelableExtra("theStop"); this.setTitle(this.getTitle() + " - " + theStop.name()); theMapView = (OSMView) findViewById(R.id.osm_map_view); theMapView.setTileSource(TileSourceFactory.MAPNIK); theMapView.setBuiltInZoomControls(true); theMapView.setOnReadyListener(this); theMapController = theMapView.getController(); theMapController.setZoom(TheApp.getResInt(R.integer.default_map_zoom) - 1); theMapController.setCenter(theStop.point()); theManager = theMapView.getOverlayManager(); theMarker = new MapMarker(this); theMarker.setLocation(theStop.point()); theManager.add(theMarker); }