Countdown timer, points and incorrect multiplying


Ask A Question





Login To post a question

I have this code as a method:

String resultTimeString = ct.toString()
    if(resultTimeString.length() == 2 ){
        resultTime1ASCII = resultTimeString.charAt(0);
        resultTime2ASCII = resultTimeString.charAt(1);
        resultTime1 = (int)resultTime1ASCII - 48;
        resultTime2 = (int)resultTime2ASCII - 48;
        resultTime = resultTime1 + resultTime2;
    }
    else{
        resultTime1ASCII = resultTimeString.charAt(0);
        resultTime1 = (int)resultTime1ASCII - 48;
        resultTime = resultTime1;
    }
    punkty = punkty * resultTime;
    //Globals.setScore(punkty);
    ct.cancel();

The problem is in counting. Final score (“punkty”) isn’t multiply punkty and resultTime and I don’t know why. Variable punkty is define as a points from giving a good answer.

Timer count down from 60 to 0.

For more info please click herehttps://stackoverflow.com/q/37253694



Have a question or need a custom quote?
info@smartinfocare.com