Timer with start and pause functionality using background thread

in this app I am starting the timer on background thread using asyncTask class.to pause the timer i am cancelling the task.to start again the timer I pressing the start button again and making a new asynctask object but it is not working ,the timer is stuck at the previous value.
Please tell me the solution.
This is the github link of the code that I have written.

A task can be cancelled at any time by invoking cancel(boolean). Invoking this method will cause subsequent calls to isCancelled() to return true. After invoking this method, onCancelled(java.lang.Object), instead of onPostExecute(java.lang.Object) will be invoked after doInBackground(java.lang.Object[]) returns. To ensure that a task is cancelled as quickly as possible, you should always check the return value of isCancelled() periodically from doInBackground(java.lang.Object[]), if possible (inside a loop for instance.)

You have done most things correct.
The bold text in above snippet explains the problem you are facing.

Therefore you have to check in each loop operation if the task is cancelled.

StopWatch class should look like this

class Stopwatch extends AsyncTask<Integer, Integer, Void> {
    @Override
    protected Void doInBackground(Integer... integers) {
        Log.d(TAG, "Do in Background: Started");
        int min=minutes;
        int sec=seconds;
        for (int i = min; i >= 0; i--) {
            if (isCancelled()) break;
            if (i == min) {
                for (int j = sec; j >= 0; j--) {
                    if (isCancelled()) break;
                    --seconds;
                    wait1sec();
                    publishProgress(i, j);
                }
            } else {
                for (int j = 59; j >= 0; j--) {
                    if (isCancelled()) break;
                    --seconds;
                    wait1sec();
                    publishProgress(i, j);
                }
            }
            if (isCancelled()) break;
            --minutes;
        }
        Log.d(TAG, "Do in Background: Ended");
        return null;
    }


    @Override
    protected void onProgressUpdate(Integer... values) {
        super.onProgressUpdate(values);
        String time = values[0] + " : " + values[1];
        if (values[0] == 0 && values[1] == 0) {
            tvTime.setText("TIME UP !!!!");
        } else
            tvTime.setText(time);
    }
}