How to minus some second from countdowntimer?
<p>I am trying a simple counter for a quiz app.here I wanted to minus some second from the timer in the button press.I used a flag which contains a true value..when the button is pressed it become false..then i check the value of the flag and tried to minus some seconds from the timer...bt it is not working.
Here is the code that i have tried...</p>

<p>the java code :</p>

<pre><code>package com.okj.hjhu;

import android.app.Activity;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class OkghActivity extends Activity implements OnClickListener {

    TextView tv;
    Button a;
    Boolean flag = true;
    CountDownTimer counter;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

        Initializer();
        setlisteners();

        MyCount counter = new MyCount(120000, 1000);

        counter.start();

    }

    private void setlisteners() {
        // TODO Auto-generated method stub

        a.setOnClickListener(this);

    }

    private void Initializer() {
        tv = (TextView) findViewById(R.id.textView1);

        a = (Button) findViewById(R.id.button1);

    }

    public class MyCount extends CountDownTimer {

        public MyCount(long millisInFuture, long countDownInterval) {
            super(millisInFuture, countDownInterval);

        }

        @Override
        public void onFinish() {
            tv.setText("done");
        }

        @Override
        public void onTick(long millisUntilFinished) {

            tv.setText("Lef Time ...  00:00:" + millisUntilFinished / 1000);

            if (flag = false) {

                long ty = millisUntilFinished - 9000;

                tv.setText("Lef Time ...  00:00:" + ty / 1000);

            }

        }

    }

    public void onClick(View v) {
        // TODO Auto-generated method stub

        switch (v.getId()) {

        case R.id.button1:
//when the button will be pressed the counter will minus some second from the timer
            flag = false;
            break;

        case R.id.button2:
            break;

        case R.id.button3:
            break;

        case R.id.button4:
            break;

        }

    }
}
</code></pre>

<p>Help please ...........</p>
