private void setDesiredPaceOrSpeed(float desiredPaceOrSpeed) { if (mService != null) { if (mMaintain == PedometerSettings.M_PACE) { mService.setDesiredPace((int) desiredPaceOrSpeed); } else if (mMaintain == PedometerSettings.M_SPEED) { mService.setDesiredSpeed(desiredPaceOrSpeed); } } }
private void resetValues(boolean updateDisplay) { if (mService != null && mIsRunning) { mService.resetValues(); } else { mStepValueView.setText("0"); mChildStepCountView.setText("0"); mChildCoinView.setText("0"); mParentCoinView.setText("0"); ; // mPaceValueView.setText("0"); // mDistanceValueView.setText("0"); // mSpeedValueView.setText("0"); // mCaloriesValueView.setText("0"); if (updateDisplay) { stateEditor.putInt("steps", 0); stateEditor.putInt("pace", 0); stateEditor.putFloat("distance", 0); stateEditor.putFloat("speed", 0); stateEditor.putFloat("calories", 0); stateEditor.putInt("parentStepCountKey", 0); stateEditor.putInt("parentCoinsKey", 0); stateEditor.putInt("childStepCountKey", 0); stateEditor.putInt("childCoinsKey", 0); stateEditor.commit(); } } }
private void resetValues(boolean updateDisplay) { if (mService != null && mIsRunning) { mService.resetValues(); } else { TextView timer = (TextView) findViewById(R.id.textView); // timer.setText("00:00"); finalTime = 0; timeSwap = 0; timeInMillies = 0; mStepValueView.setText("0"); mPaceValueView.setText("0"); mDistanceValueView.setText("0"); mSpeedValueView.setText("0"); mCaloriesValueView.setText("0"); mTimeValueView.setText("00:00"); SharedPreferences state = getSharedPreferences("state", 0); SharedPreferences.Editor stateEditor = state.edit(); if (updateDisplay) { stateEditor.putInt("steps", 0); stateEditor.putInt("pace", 0); stateEditor.putFloat("distance", 0); stateEditor.putFloat("speed", 0); stateEditor.putFloat("calories", 0); stateEditor.putLong("time", 0); stateEditor.commit(); } } Toast.makeText(getApplicationContext(), "Pedometer Reset!", Toast.LENGTH_LONG).show(); }
private void resetValues(boolean updateDisplay) { if (mService != null && mIsRunning) { mService.resetValues(); } else { mStepValueView.setText("0"); mPaceValueView.setText("0"); mDistanceValueView.setText("0"); mSpeedValueView.setText("0"); mCaloriesValueView.setText("0"); SharedPreferences state = getSharedPreferences("state", 0); SharedPreferences.Editor stateEditor = state.edit(); if (updateDisplay) { stateEditor.putInt("steps", 0); stateEditor.putInt("pace", 0); stateEditor.putFloat("distance", 0); stateEditor.putFloat("speed", 0); stateEditor.putFloat("calories", 0); stateEditor.commit(); } } }
public void onServiceConnected(ComponentName className, IBinder service) { mService = ((StepService.StepBinder) service).getService(); mService.registerCallback(mCallback); mService.reloadSettings(); }