Exemplo n.º 1
0
        public void onServiceConnected(ComponentName name, IBinder service) {
          loggingService = ((GpsLoggingService.GpsLoggingBinder) service).getService();
          GpsLoggingService.SetServiceClient(GpsMainActivity.this);

          Button buttonSinglePoint = (Button) findViewById(R.id.buttonSinglePoint);

          buttonSinglePoint.setOnClickListener(GpsMainActivity.this);

          if (Session.isStarted()) {
            if (Session.isSinglePointMode()) {
              SetMainButtonEnabled(false);
            } else {
              SetMainButtonChecked(true);
              SetSinglePointButtonEnabled(false);
            }

            DisplayLocationInfo(Session.getCurrentLocationInfo());
          }

          // Form setup - toggle button, display existing location info
          ToggleButton buttonOnOff = (ToggleButton) findViewById(R.id.buttonOnOff);
          buttonOnOff.setOnCheckedChangeListener(GpsMainActivity.this);
        }
Exemplo n.º 2
0
 public void SetMainButtonChecked(boolean checked) {
   ToggleButton buttonOnOff = (ToggleButton) findViewById(R.id.buttonOnOff);
   buttonOnOff.setChecked(checked);
 }
Exemplo n.º 3
0
 public void SetMainButtonEnabled(boolean enabled) {
   ToggleButton buttonOnOff = (ToggleButton) findViewById(R.id.buttonOnOff);
   buttonOnOff.setEnabled(enabled);
 }