예제 #1
0
  /** Called when one of the menu items is selected. */
  public boolean onOptionsItemSelected(MenuItem item) {

    int itemId = item.getItemId();
    Utilities.LogInfo("Option item selected - " + String.valueOf(item.getTitle()));

    switch (itemId) {
      case R.id.mnuSettings:
        Intent settingsActivity = new Intent(getApplicationContext(), GpsSettingsActivity.class);
        startActivity(settingsActivity);
        break;
      case R.id.mnuOSM:
        UploadToOpenStreetMap();
        break;
      case R.id.mnuDropBox:
        UploadToDropBox();
        break;
      case R.id.mnuAnnotate:
        Annotate();
        break;
      case R.id.mnuShare:
        Share();
        break;
      case R.id.mnuEmailnow:
        EmailNow();
        break;
      case R.id.mnuExit:
        loggingService.StopLogging();
        loggingService.stopSelf();
        finish();
        break;
    }
    return false;
  }
예제 #2
0
  public void OnLocationUpdate(Location loc) {
    Utilities.LogDebug("GpsMainActivity.OnLocationUpdate");
    DisplayLocationInfo(loc);
    ShowPreferencesSummary();
    SetMainButtonChecked(true);

    if (Session.isSinglePointMode()) {
      loggingService.StopLogging();
      SetMainButtonEnabled(true);
      Session.setSinglePointMode(false);
    }
  }
예제 #3
0
  /** Called when the toggle button is clicked */
  public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
    Utilities.LogDebug("GpsMainActivity.onCheckedChanged");

    if (isChecked) {
      GetPreferences();
      SetSinglePointButtonEnabled(false);
      loggingService.StartLogging();
    } else {
      SetSinglePointButtonEnabled(true);
      loggingService.StopLogging();
    }
  }
예제 #4
0
  /** Called when the single point button is clicked */
  public void onClick(View view) {
    Utilities.LogDebug("GpsMainActivity.onClick");

    if (!Session.isStarted()) {
      SetMainButtonEnabled(false);
      loggingService.StartLogging();
      Session.setSinglePointMode(true);
    } else if (Session.isStarted() && Session.isSinglePointMode()) {
      loggingService.StopLogging();
      SetMainButtonEnabled(true);
      Session.setSinglePointMode(false);
    }
  }