title: When the screen turns Off, the countdowntimer doesn't work properly
body: <p>I have implemented a class which extends a CountDownTimer and it works good, but when the screen is turned Off, the timer is desynchronized, so the idea is that, when I get out of the activity or the screen is Off, the CountDownTimer should be continue working properly. I have the permission <code>&lt;uses-permission android:name="android.permission.WAKE_LOCK"/&gt;</code>, also I have tried with <code>PowerManager</code>, but I think the problem is not there.</p>
  
  <pre><code>PowerManager pm = (PowerManager) getSystemService((MenuApp.this).POWER_SERVICE);
  PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "My Tag");
         wl.acquire();
         myTimer =  new CustomTimer(min, 1000); 
         myTimer.start();                    
         wl.release();
  </code></pre>
  
  <p>.</p>
  
  <pre><code>@TargetApi(Build.VERSION_CODES.GINGERBREAD) @SuppressLint("NewApi")
  public class CustomTimer extends CountDownTimer
  {
      public CustomTimer(long millisInFuture, long countDownInterval) 
      {
  
          super( millisInFuture, countDownInterval );
          byteTimer = 1;
      }
      @TargetApi(Build.VERSION_CODES.GINGERBREAD) 
      @SuppressLint("NewApi")
      @Override
      public synchronized void onTick(long millisUntilDone) 
      {
     String hms = String.format("%02d:%02d", 
             TimeUnit.MILLISECONDS.toMinutes(millisUntilDone)- TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(millisUntilDone)),
             TimeUnit.MILLISECONDS.toSeconds(millisUntilDone)-TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millisUntilDone)));
  
                   tim.setText(hms);
                   edit.putLong("Minute",  millisUntilDone-1669);
                   edit.commit();
  
      }
      @TargetApi(Build.VERSION_CODES.GINGERBREAD) 
      @SuppressLint("NewApi")
      @Override
      public synchronized void onFinish() 
      {   
          tim.setText("00:00");
                  seconds = 0L;
                  if(btnToggle.isChecked()){   
                          btnToggle.setChecked(false);
                          btnToggleTimer.setChecked(false);                   
                      }else{
                          btnToggle.setChecked(true);
                          btnToggleTimer.setChecked(false);
              }         
          }
      }
  </code></pre>