I am implementing counter of 15,then i split the counter value so that i can set "1" in one text view and "5" in another text view.Same is with 14 "1" in one text view and "4"in another.But what it does is not showing "14" from "15" to it jumps to "13".Please help me.Below is my code
Code:-
handler.postDelayed(new Runnable() {
@Override
public void run() {
MainActivity.help_icon.setClickable(false);
new CountDownTimer(15000,1000) {
public void onTick(long millisUntilFinished) {
hideDigits();
hideRowOneTwoFourSixElements();
digit2.setVisibility(View.VISIBLE);
digit3.setVisibility(View.VISIBLE);
digit4.setVisibility(View.VISIBLE);
digit2.setText("0:");
String count=""+millisUntilFinished / 1000;
String[] mArray = count.split("");
Log.i("tag","count outside->"+count);
if(count.length()==1)
{
digit3.setVisibility(View.VISIBLE);
digit3.setText("0");
try
{
digit4.setText(mArray[1]);
}
catch (Exception e){}
}
else
{
try
{
Log.i("tag","count inside->"+count + "array 1-->"+ mArray[1]);
digit3.setText(mArray[1]);
}
catch (Exception e)
{
}
try{
Log.i("tag","count inside->"+count + "array 2-->"+ mArray[2]);
digit4.setText(mArray[2]);
}catch (Exception e){}
}
}
public void onFinish() {
mode_button.setEnabled(true);
isRunning=true;
mainDisplay();
}
}.start();
}
}, 7000);
}