Search code examples
javaandroidcountdown

After finishing the countdown I want to show number of counts in a Text View ,eg: after finishing 1st round Text view should show x1, for 2nd round x2


[enter image description here][1]

emphasized text [1]: https://i.sstatic.net/tNgwZ.png


Solution

  • Create a global var and increment that with every timer reset

    Example

    int timerCounts = 0;
    
    @Override
    onCreate....
    
    
    private void starttimer(){
      ......
      .....
      onFinish(){
        timerCounts++;
        your_text_view_to_show_counts.setText(timerCounts+'X');
      }
    
    }