@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); } }