I want to change colour of countdowntimer in a specific time. For example, After 50 sec, colour changes greeen to yellow.Could you help me please? Here, you can check my code. Till 50 sec ok.the colour is green. However, after 50th sec, app crashes.
final CountDownTimer countDownTimer = new CountDownTimer(60000, 1000)
{
public void onTick(long millisUntilFinished) {
x = millisUntilFinished/1000;
timer.setText( x + " remaining left ");
if ( 50< x ){
timer.setTextColor(Color.parseColor("#32e76b"));
}
else{
timer.setTextColor(Color.parseColor("FFE9DD33"));
}