title: Reset step count and start calculating step from 0
body: <p>I have a pedometer which calculates the steps from device sensors perfectly. i want to reset the step count to 0 when move to another activity and starts the stepcount from 0 instead of the earlier stepcount.</p>
  
  <p>I tried to save my initial step count and subtract it from the current sensor data but the steps are not calculating it's showing me only 0 and 1.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>Activity1.java 
    private  String Initial_Count_Key = "FootStepInitialCount";  
   public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
  SharedPreferenceManager.singleton().save(Initial_Count_Key,total_step);}
  </code></pre>
  
  <p>Here is my activity2 where I want to reset my steps. I wrote a method for it also but I think I am doing something wrong.</p>
  
  <pre><code>Activity2.java
   private void countStep() {
  
          mIntialSteps = (SharedPreferenceManager.singleton().getInt("FootStepInitialCount"));
          mUpdatedSteps = StepDetector.CURRENT_SETP - mIntialSteps;
          Log.i("Updated_Steps", String.valueOf(mUpdatedSteps));
  
          if (mUpdatedSteps % 2 == 0) {
              mStepCountValue = mUpdatedSteps;
  
          } else {
              mStepCountValue = mUpdatedSteps + 1;
          }
  
          mStepCountValue = mUpdatedSteps ;
  
      }
  </code></pre>
  
  <p>Can someone tell me what I am doing wrong?</p>