I'm trying to pass the countdowntimer a variable and use that variable as the amount of milliseconds to count down. If I simply enter the value the countdown works properly, but if I pass it a long variable it just runs the onFinish function.
Here's the actual code:

public CountDownTimer countDown = new CountDownTimer(respawnTime, 1000) { @Override public void onTick(long millisUntilFinished) { timer =(Integer)(int) millisUntilFinished / 1000; if(timer < 31) timerText.setTextColor(Color.parseColor("#FF0000") ); timerText.setText(timer.toString()); } @Override public void onFinish() { timerText.setTextColor(Color.parseColor("#00FF00") ); timerText.setText("UP"); }};At this point I have respawnTime set to equal 360000 hoping for a 360 second countdown, but like I said it just immediately runs the onFinish. Simply changing the first parameter to a literal instead of a variable fixes everything but I need to use a variable here. Thanks in advance for the help!


Check Solution