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); }
public void SetMainButtonChecked(boolean checked) { ToggleButton buttonOnOff = (ToggleButton) findViewById(R.id.buttonOnOff); buttonOnOff.setChecked(checked); }
public void SetMainButtonEnabled(boolean enabled) { ToggleButton buttonOnOff = (ToggleButton) findViewById(R.id.buttonOnOff); buttonOnOff.setEnabled(enabled); }